nativeFloatPop.js 992 B

1234567891011121314151617181920212223242526272829303132
  1. //-------------------------------------------------------------------------------------------------------
  2. // Copyright (C) Microsoft. All rights reserved.
  3. // Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
  4. //-------------------------------------------------------------------------------------------------------
  5. //Test0: NativeIntArray to NativeFloatArray
  6. var ary =[1,2,3,4];
  7. function test0(i)
  8. {
  9. return ary.pop();
  10. }
  11. WScript.Echo("Test0:");
  12. WScript.Echo(test0(1));
  13. ary[4]=1.1; //Should Bailout as the type of the array is changed.
  14. WScript.Echo(test0(1));
  15. //Test1: NativeFloatArray - popping missing value.
  16. var ary2 = new Array(10);
  17. ary2[0] = 1.1;
  18. function test1()
  19. {
  20. return ary2.pop();
  21. }
  22. WScript.Echo("Test1:");
  23. WScript.Echo("length = "+ary2.length);
  24. WScript.Echo(test1());
  25. WScript.Echo("length = "+ary2.length);
  26. WScript.Echo(test1());
  27. WScript.Echo("length = "+ary2.length);