-
Notifications
You must be signed in to change notification settings - Fork 1.2k
/
Copy pathextensible.js
54 lines (41 loc) · 1.63 KB
/
extensible.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
//-------------------------------------------------------------------------------------------------------
// Copyright (C) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
//-------------------------------------------------------------------------------------------------------
var a = {x:20, y:30};
Object.preventExtensions(a);
var b = {x:20, y:30};
Object.preventExtensions(b);
var c = {x:20, y:30};
Object.preventExtensions(c);
var d = {x:20, y:30};
Object.preventExtensions(d);
var e = {get x() {return 0;}, y:30};
Object.preventExtensions(e);
WScript.SetTimeout(testFunction, 50);
/////////////////
function testFunction()
{
a.z = 50;
telemetryLog(`${Object.getOwnPropertyNames(a)}`, true);
telemetryLog(`${Object.isExtensible(a)}`, true);
delete b.x;
telemetryLog(`${b.x}`, true);
telemetryLog(`${Object.isExtensible(b)}`, true);
c.x = 40;
c.y = 60;
telemetryLog(`${Object.getOwnPropertyNames(c)}`, true);
telemetryLog(`${Object.isExtensible(c)}`, true);
telemetryLog(`${c.x}`, true);
delete d.x;
Object.defineProperty(d, "y", {configurable: false});
telemetryLog(`${Object.isSealed(d)}`, true);
Object.defineProperty(d, "y", {writable: false});
telemetryLog(`${Object.isFrozen(d)}`, true);
delete e.x;
Object.defineProperty(e, "y", {configurable: false});
telemetryLog(`${Object.isSealed(e)}`, true);
Object.defineProperty(e, "y", {writable: false});
telemetryLog(`${Object.isFrozen(e)}`, true);
emitTTDLog(ttdLogURI);
}