forked from chakra-core/ChakraCore
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathenum.js
More file actions
172 lines (118 loc) · 2.66 KB
/
enum.js
File metadata and controls
172 lines (118 loc) · 2.66 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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
//-------------------------------------------------------------------------------------------------------
// Copyright (C) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
//-------------------------------------------------------------------------------------------------------
var i;
Object.prototype.u ="o.p.u";
Object.prototype.x ="o.p.x";
Object.prototype.y = "o.p.y";
Object.prototype.z = "o.p.z";
var f1 = function(){};
f1.prototype.x = "f.p.x";
f1.prototype.q = "f.p.q";
f1.prototype.z = "f.p.z";
f1.prototype.r = "f.p.r";
var a1 = new f1();
a1.x = "a.x";
a1.q = "a.q";
a1.u = "a.q";
for (i in a1)
{
WScript.Echo(i+":"+a1[i]);
}
var a = new Object();
a.x="hello";
a.y="world";
var o = new foo();
o.pqr = "pqr";
WScript.Echo("Object a");
for (i in a)
{
WScript.Echo(i);
}
WScript.Echo("Math");
for (i in Math)
{
WScript.Echo(i);
}
WScript.Echo("Array");
for (i in Array)
{
WScript.Echo(i);
}
WScript.Echo("Array.prototype");
for (i in Array.prototype)
{
WScript.Echo(i);
}
WScript.Echo("Date");
for (i in Date)
{
WScript.Echo(i);
}
WScript.Echo("Number");
for (i in Number)
{
WScript.Echo(i);
}
WScript.Echo("String");
for (i in String)
{
WScript.Echo(i);
}
WScript.Echo("Object.prototype");
Object.prototype.z = "me too";
for (i in Object.prototype)
{
WScript.Echo(i);
}
WScript.Echo("Object");
for (i in Object)
{
WScript.Echo(i);
}
WScript.Echo("Array.prototype.sort");
for(i in Array.prototype.sort)
{
WScript.Echo(i);
}
WScript.Echo("function foo");
function foo()
{
this.xyz = "xyz";
}
for(i in foo)
{
WScript.Echo(i);
}
Array.prototype.sort.x = "hello"
var o = Array.prototype.sort;
for (i in Array.prototype.sort)
{
WScript.Echo(i);
}
WScript.Echo("me here");
WScript.Echo("prototype chain");
Object.prototype.x = 10;
function f() { }
function g() { }
g.prototype = new f();
y = new g();
for (i in y) { WScript.Echo(i); }
var aString = "StringType";
String.prototype.zz = "s.p.zz";
var bString = new String("StringObject");
bString.xx = "bString.xx";
bString.yy = "bString.yy";
WScript.Echo("Literal String");
for( i in aString) { WScript.Echo(i); }
WScript.Echo("String Object");
for( i in bString) { WScript.Echo(i); }
function Person(){}
Person.prototype[5]=20;
var a = new Person();
for (var i in a) { WScript.Echo(i); }
Array.prototype[3] = 3;
var a = new Array();
for (var i in a) { WScript.Echo(i); }
for ( i in null ) { WScript.Echo(i); }