forked from chakra-core/ChakraCore
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlargeAuxArray.js
More file actions
33 lines (26 loc) · 1004 Bytes
/
largeAuxArray.js
File metadata and controls
33 lines (26 loc) · 1004 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
//-------------------------------------------------------------------------------------------------------
// Copyright (C) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
//-------------------------------------------------------------------------------------------------------
var o = { };
function AddAccessorProperty()
{
// add accessor property (converts to DictionaryTypeHandler)
Object.defineProperty(o, "a", { get: function () { return 10; } , configurable: true} );
}
function AddPropertiesToObjectArray()
{
// add enough properties to convert to BigDictionaryTypeHandler
for (var i = 0; i < 25000; i++) {
o["p" + i] = 0;
}
}
AddAccessorProperty();
AddPropertiesToObjectArray();
AddAccessorProperty();
WScript.SetTimeout(testFunction, 50);
/////////////////
function testFunction()
{
telemetryLog(`o.a === 10: ${o.a === 10}`, true);
}