es5array_objproto.js 724 B

12345678910111213141516171819
  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 test0(o, p) {
  6. o[p] = "set";
  7. }
  8. var p = 0;
  9. var o = [];
  10. var o2 = [];
  11. Object.prototype[p] = null;
  12. test0(o, p);
  13. WScript.Echo(o[p]);
  14. Object.defineProperty(Object.prototype, p, { configurable: true, enumerable: true, writable: false, value: null });
  15. test0(o2, p);
  16. WScript.Echo(o2[p]);