-
Notifications
You must be signed in to change notification settings - Fork 1.2k
/
Copy pathfreeze.js
46 lines (36 loc) · 1.21 KB
/
freeze.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
//-------------------------------------------------------------------------------------------------------
// 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.freeze(a);
var b = {x:20, y:30};
Object.freeze(b);
var c = {x:20, y:30};
Object.freeze(c);
WScript.SetTimeout(testFunction, 50);
/////////////////
function testFunction()
{
a.z = 50;
try
{
Object.defineProperty(a, 'ohai', { value: 17 });
}
catch(e)
{
telemetryLog(`${e}`, true);
}
telemetryLog(`${Object.getOwnPropertyNames(a)}`, true);
telemetryLog(`${Object.isFrozen(a)}`, true);
delete b.x;
telemetryLog(`${Object.getOwnPropertyNames(b)}`, true);
telemetryLog(`${Object.isFrozen(b)}`, true);
telemetryLog(`${b.x}`, true);
a.c = 40;
a.c = 60;
telemetryLog(`${Object.getOwnPropertyNames(c)}`, true);
telemetryLog(`${Object.isFrozen(c)}`, true);
telemetryLog(`${c.x}`, true);
emitTTDLog(ttdLogURI);
}