]> git.saurik.com Git - apple/javascriptcore.git/blob - tests/stress/freeze_leek.js
JavaScriptCore-7601.1.46.3.tar.gz
[apple/javascriptcore.git] / tests / stress / freeze_leek.js
1 var o = Object.freeze([]),
2 leak = {};
3
4 try {
5 throw o;
6 } catch (ex) {}
7
8 if(o.stack !== undefined)
9 throw new Error("the stack was leaked.");
10
11 o.stack = leak;
12
13 if(o.stack === leak)
14 throw new Error("the object wasn't frozen.");
15
16 o.other = "wrong";
17
18 if(o.other === "wrong")
19 throw new Error("the object wasn't frozen.");
20
21
22 o = Object.freeze({"hi": "other"});
23
24 try {
25 throw o;
26 } catch (ex) {}
27 o.stack = leak;
28
29
30 if(o.stack !== undefined)
31 throw new Error("the stack was leaked.");
32
33 o.stack = leak;
34
35 if(o.stack === leak)
36 throw new Error("the object wasn't frozen.");
37
38 o.other = "wrong";
39
40 if(o.other === "wrong")
41 throw new Error("the object wasn't frozen.");