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
28 lines (22 loc) · 965 Bytes
/
LargeAuxArray.js
File metadata and controls
28 lines (22 loc) · 965 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
//-------------------------------------------------------------------------------------------------------
// Copyright (C) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
//-------------------------------------------------------------------------------------------------------
//Run with -nonative -BigDictionaryTypeHandlerThreshold:20
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 < 25; i++) {
o["p" + i] = 0;
}
}
AddAccessorProperty();
AddPropertiesToObjectArray();
AddAccessorProperty();
WScript.Echo(o.a === 10 ? "PASSED" : "FAILED");