forked from chakra-core/ChakraCore
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtypedArrayProfile.js
More file actions
62 lines (52 loc) · 1.11 KB
/
typedArrayProfile.js
File metadata and controls
62 lines (52 loc) · 1.11 KB
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
//-------------------------------------------------------------------------------------------------------
// Copyright (C) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
//-------------------------------------------------------------------------------------------------------
var Arr = new Float64Array(100);
var Arr2 = new Array(100);
var Obj = new Object();
var Failed = 0;
function FAILED()
{
Failed++;
WScript.Echo("FAILED");
}
Obj.prop1 = 1;
Obj.prop2 = 1;
Obj.prop3 = 1;
Obj.prop4 = 1;
Obj.prop5 = 1;
Obj.prop6 = 1;
Obj.prop7 = 1;
Obj.prop8 = 1;
var x = 0.1;
var one = 1;
function init(o)
{
for (var str in o)
{
o[str] = x * one;
}
}
function verify(o)
{
for (var str in o)
{
if (o[str] !== x)
{
FAILED();
}
}
}
// Build profile data
init(Arr);
// Init property string cache
init(Obj);
// Hit bug
init(Obj);
// Obj has garbage
verify(Obj);
if (Failed === 0)
{
WScript.Echo("Passed");
}