forked from chakra-core/ChakraCore
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdeep.js
More file actions
34 lines (27 loc) · 866 Bytes
/
deep.js
File metadata and controls
34 lines (27 loc) · 866 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
34
//-------------------------------------------------------------------------------------------------------
// Copyright (C) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
//-------------------------------------------------------------------------------------------------------
// Creates a deep inheritance chain.
var n = 0;
var count = 30;
function Create(x)
{
this[n++] = x;
Create.prototype = this;
}
var a = new Array(count);
for(var i = 0; i < count; ++i)
{
var x = new Create(i);
a[i] = x;
}
for(var i = 0; i < count; ++i)
{
WScript.Echo("starting " + i);
// j <= i+1 because we intentionally access undefined properties
for(var j = 0; j <= i+1; ++j)
{
WScript.Echo("" + a[i][j]);
}
}