missing.js 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  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. function write(v) { WScript.Echo(v + ""); }
  6. Object.prototype[5] = "obj.proto5";
  7. Object.prototype[7] = "obj.proto7";
  8. Array.prototype[1] = "arr.proto.1";
  9. Array.prototype[2] = "arr.proto.2";
  10. Array.prototype[3] = "arr.proto.3";
  11. Array.prototype[6] = "arr.proto.6";
  12. var n=8;
  13. var arr = new Array(4);
  14. arr[1] = null;
  15. arr[2] = undefined;
  16. for (var i=0;i<n;i++) {
  17. write("arr[" + i + "] : " + arr[i]);
  18. }
  19. function test() {
  20. var x;
  21. switch (x) {
  22. default:
  23. [1, , ];
  24. }
  25. };
  26. test();
  27. test();
  28. function ArrayLiteralMissingValue()
  29. {
  30. var arr1 = [1, 1, -2147483646];
  31. write("[] missing value:" + arr1[2]);
  32. }
  33. ArrayLiteralMissingValue();
  34. function ArrayConstructorMissingValue()
  35. {
  36. var IntArr0 = new Array(-1, -2147483646);
  37. write("Array() missing value:" + IntArr0[1]);
  38. }
  39. ArrayConstructorMissingValue();