largeAuxArray.js 1004 B

123456789101112131415161718192021222324252627282930313233
  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 o = { };
  6. function AddAccessorProperty()
  7. {
  8. // add accessor property (converts to DictionaryTypeHandler)
  9. Object.defineProperty(o, "a", { get: function () { return 10; } , configurable: true} );
  10. }
  11. function AddPropertiesToObjectArray()
  12. {
  13. // add enough properties to convert to BigDictionaryTypeHandler
  14. for (var i = 0; i < 25000; i++) {
  15. o["p" + i] = 0;
  16. }
  17. }
  18. AddAccessorProperty();
  19. AddPropertiesToObjectArray();
  20. AddAccessorProperty();
  21. WScript.SetTimeout(testFunction, 50);
  22. /////////////////
  23. function testFunction()
  24. {
  25. telemetryLog(`o.a === 10: ${o.a === 10}`, true);
  26. }