-
Notifications
You must be signed in to change notification settings - Fork 1.2k
/
Copy pathObjectHeaderInlining.js
61 lines (45 loc) · 1.15 KB
/
ObjectHeaderInlining.js
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
//-------------------------------------------------------------------------------------------------------
// Copyright (C) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
//-------------------------------------------------------------------------------------------------------
//flags : -off:simplejit -mic:1
function TwoProperty(p, q) {
this.p = p;
this.q = q;
}
function OneProperty(x){
this.x = x;
}
function CreateTwoPropertyObj()
{
var a = new TwoProperty(2, 3);
return a;
}
function CreateOnePropertyObj()
{
var a = new OneProperty(4)
return a;
}
function grow(a, r, s)
{
a.r = r;
a.s = s;
}
var obj;
var obj1;
for(i = 0; i < 5; i++)
{
obj = CreateTwoPropertyObj();
obj1 = CreateOnePropertyObj();
}
//Try grow and overwrite properties.
grow(obj, 10, 20);
obj = CreateTwoPropertyObj();
grow(obj, 10, 20);
obj = CreateTwoPropertyObj();
grow(obj, 10, 20);
WScript.Echo(obj.p);
WScript.Echo(obj.q);
WScript.Echo(obj.r);
WScript.Echo(obj.s);
WScript.Echo(obj1.x);