es5array_arrayproto_crosssite.js 720 B

123456789101112131415161718192021222324
  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. var crossSiteGlo = WScript.LoadScriptFile("es5array_crosssite.js", "samethread");
  6. Object.defineProperty(Array.prototype, "1", { value: "const", writable: false });
  7. function test()
  8. {
  9. var arr = new Array(2);
  10. arr[0] = 0;
  11. arr[1] = 1;
  12. WScript.Echo(arr);
  13. crossSiteGlo.SetArrayIndex(arr, 1);
  14. WScript.Echo(arr);
  15. }
  16. test();
  17. test();