forked from chakra-core/ChakraCore
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patharraybufferType.js
More file actions
39 lines (36 loc) · 1.03 KB
/
arraybufferType.js
File metadata and controls
39 lines (36 loc) · 1.03 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
//-------------------------------------------------------------------------------------------------------
// Copyright (C) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
//-------------------------------------------------------------------------------------------------------
var d = ArrayBuffer.prototype;
WScript.Echo(d);
d.aaa = 20;
var a = Object.getPrototypeOf(new Int8Array(1).buffer);
a.foo = 20;
a.bar = 42;
WScript.Echo(a);
WScript.Echo(a.foo);
var b = Object.getPrototypeOf(new Int16Array(0).buffer);
WScript.Echo(b);
for (var i in b)
{
WScript.Echo(i + ' = ' + b[i]);
}
WScript.Echo(b.foo);
var c = Object.getOwnPropertyNames(b);
for (var i in c)
{
WScript.Echo(c[i]);
}
WScript.Echo(a == b);
var e = new Int32Array(0).buffer.constructor.prototype;
WScript.Echo(e.foo);
for (var i in e)
{
WScript.Echo(i + ' = ' + e[i]);
}
var ee = Object.getOwnPropertyNames(e);
for (var i in ee)
{
WScript.Echo(ee[i]);
}