/
basic-strict-mode-expected.txt
126 lines (121 loc) · 11.4 KB
/
basic-strict-mode-expected.txt
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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
Test behaviour of strict mode
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
PASS testThis.call(null) is null
PASS testThis.call(1) is 1
PASS testThis.call(true) is true
PASS testThis.call(false) is false
PASS testThis.call(undefined) is undefined
PASS testThis.call('a string') is 'a string'
PASS testThisDotAccess.call('a string') is 'a string'.length
PASS testThisDotAccess.call(null) threw exception TypeError: Result of expression 'this' [null] is not an object..
PASS testThisDotAccess.call(undefined) threw exception TypeError: Result of expression 'this' [undefined] is not an object..
PASS testThisDotAccess.call(true) is undefined.
PASS testThisDotAccess.call(false) is undefined.
PASS testThisDotAccess.call(1) is undefined.
PASS testThisBracketAccess.call('a string', 'length') is 'a string'.length
PASS testThisBracketAccess.call(null, 'length') threw exception TypeError: Result of expression 'this' [null] is not an object..
PASS testThisBracketAccess.call(undefined, 'length') threw exception TypeError: Result of expression 'this' [undefined] is not an object..
PASS testThisBracketAccess.call(true, 'length') is undefined.
PASS testThisBracketAccess.call(false, 'length') is undefined.
PASS testThisBracketAccess.call(1, 'length') is undefined.
PASS testGlobalAccess() is null
PASS (function eval(){'use strict';}) threw exception SyntaxError: Parse error.
PASS (function (eval){'use strict';}) threw exception SyntaxError: Parse error.
PASS (function arguments(){'use strict';}) threw exception SyntaxError: Parse error.
PASS (function (arguments){'use strict';}) threw exception SyntaxError: Parse error.
PASS (function (){'use strict'; var eval;}) threw exception SyntaxError: Parse error.
PASS (function (){'use strict'; var arguments;}) threw exception SyntaxError: Parse error.
PASS (function (){'use strict'; try{}catch(eval){}}) threw exception SyntaxError: Parse error.
PASS (function (){'use strict'; try{}catch(arguments){}}) threw exception SyntaxError: Parse error.
PASS (function (a, a){'use strict';}) threw exception SyntaxError: Parse error.
PASS (function (a){'use strict'; delete a;})() threw exception SyntaxError: Parse error.
PASS (function (){'use strict'; var a; delete a;})() threw exception SyntaxError: Parse error.
PASS (function (){var a; function f() {'use strict'; delete a;} })() threw exception SyntaxError: Parse error.
PASS (function (){'use strict'; with(1){};}) threw exception SyntaxError: Parse error.
PASS (function (){'use strict'; arguments.callee; })() threw exception TypeError: Unable to access callee of strict mode function.
PASS (function (){'use strict'; arguments.caller; })() threw exception TypeError: Unable to access caller of strict mode function.
PASS (function f(){'use strict'; f.arguments; })() threw exception TypeError: Can't access arguments object of a strict mode function.
PASS (function f(){'use strict'; f.caller; })() threw exception TypeError: Cannot access caller property of a strict mode function.
PASS (function f(){'use strict'; f.arguments=5; })() threw exception TypeError: Cannot access arguments property of a strict mode function.
PASS (function f(){'use strict'; f.caller=5; })() threw exception TypeError: Cannot access caller property of a strict mode function.
PASS (function (arg){'use strict'; arguments.callee; })() threw exception TypeError: Unable to access callee of strict mode function.
PASS (function (arg){'use strict'; arguments.caller; })() threw exception TypeError: Unable to access caller of strict mode function.
PASS (function f(arg){'use strict'; f.arguments; })() threw exception TypeError: Can't access arguments object of a strict mode function.
PASS (function f(arg){'use strict'; f.caller; })() threw exception TypeError: Cannot access caller property of a strict mode function.
PASS (function f(arg){'use strict'; f.arguments=5; })() threw exception TypeError: Cannot access arguments property of a strict mode function.
PASS (function f(arg){'use strict'; f.caller=5; })() threw exception TypeError: Cannot access caller property of a strict mode function.
PASS 'use strict'; (function (){with(1){};}) threw exception SyntaxError: Parse error.
PASS 'use strict'; (function (){var a; delete a;}) threw exception SyntaxError: Parse error.
PASS 'use strict'; var a; (function (){ delete a;}) threw exception SyntaxError: Parse error.
PASS var a; (function (){ 'use strict'; delete a;}) threw exception SyntaxError: Parse error.
PASS 'misc directive'; 'use strict'; with({}){} threw exception SyntaxError: Parse error.
PASS 'use strict'; return threw exception SyntaxError: Parse error.
PASS 'use strict'; break threw exception SyntaxError: Parse error.
PASS 'use strict'; continue threw exception SyntaxError: Parse error.
PASS 'use strict'; for(;;)return threw exception SyntaxError: Parse error.
PASS 'use strict'; for(;;)break missingLabel threw exception SyntaxError: Parse error.
PASS 'use strict'; for(;;)continue missingLabel threw exception SyntaxError: Parse error.
PASS 'use strict'; 007; threw exception SyntaxError: Parse error.
PASS 'use strict'; '\007'; threw exception SyntaxError: Parse error.
PASS '\007'; 'use strict'; threw exception SyntaxError: Parse error.
PASS 'use strict'; (function (){ delete someDeclaredGlobal;}) threw exception SyntaxError: Parse error.
PASS (function (){ 'use strict'; delete someDeclaredGlobal;}) threw exception SyntaxError: Parse error.
PASS 'use strict'; if (0) { someGlobal = 'Shouldn\'t be able to assign this.'; }; true; is true
PASS 'use strict'; someGlobal = 'Shouldn\'t be able to assign this.'; threw exception ReferenceError: Strict mode forbids implicit creation of global property 'someGlobal'.
PASS 'use strict'; eval('var introducedVariable = "FAIL: variable introduced into containing scope";'); introducedVariable threw exception ReferenceError: Can't find variable: introducedVariable.
PASS 'use strict'; objectWithReadonlyProperty.prop = 'fail' threw exception TypeError: Attempted to assign to readonly property..
PASS 'use strict'; delete objectWithReadonlyProperty.prop threw exception TypeError: Unable to delete property..
PASS 'use strict'; delete objectWithReadonlyProperty[readonlyPropName] threw exception TypeError: Unable to delete property..
PASS 'use strict'; ++eval threw exception SyntaxError: Parse error.
PASS 'use strict'; eval++ threw exception SyntaxError: Parse error.
PASS 'use strict'; --eval threw exception SyntaxError: Parse error.
PASS 'use strict'; eval-- threw exception SyntaxError: Parse error.
PASS 'use strict'; function f() { ++arguments } threw exception SyntaxError: Parse error.
PASS 'use strict'; function f() { arguments++ } threw exception SyntaxError: Parse error.
PASS 'use strict'; function f() { --arguments } threw exception SyntaxError: Parse error.
PASS 'use strict'; function f() { arguments-- } threw exception SyntaxError: Parse error.
PASS global.eval('"use strict"; if (0) ++arguments; true;') is true
PASS 'use strict'; ++(1, eval) threw exception ReferenceError: Prefix ++ operator applied to value that is not a reference..
PASS 'use strict'; (1, eval)++ threw exception ReferenceError: Postfix ++ operator applied to value that is not a reference..
PASS 'use strict'; --(1, eval) threw exception ReferenceError: Prefix -- operator applied to value that is not a reference..
PASS 'use strict'; (1, eval)-- threw exception ReferenceError: Postfix -- operator applied to value that is not a reference..
PASS 'use strict'; function f() { ++(1, arguments) } threw exception SyntaxError: Parse error.
PASS 'use strict'; function f() { (1, arguments)++ } threw exception SyntaxError: Parse error.
PASS 'use strict'; function f() { --(1, arguments) } threw exception SyntaxError: Parse error.
PASS 'use strict'; function f() { (1, arguments)-- } threw exception SyntaxError: Parse error.
PASS 'use strict'; if (0) delete +a.b threw exception SyntaxError: Parse error.
PASS 'use strict'; if (0) delete ++a.b threw exception SyntaxError: Parse error.
PASS 'use strict'; if (0) delete void a.b threw exception SyntaxError: Parse error.
PASS (function (a){'use strict'; a = false; return a !== arguments[0]; })(true) is true
PASS (function (a){'use strict'; arguments[0] = false; return a !== arguments[0]; })(true) is true
PASS (function (a){'use strict'; a=false; return arguments; })(true)[0] is true
PASS (function (a){'use strict'; arguments[0]=false; return a; })(true) is true
PASS (function (a){'use strict'; arguments[0]=true; return arguments; })(false)[0] is true
PASS (function (){'use strict'; arguments[0]=true; return arguments; })(false)[0] is true
PASS (function (a){'use strict'; arguments[0]=true; a=false; return arguments; })()[0] is true
PASS (function (a){'use strict'; arguments[0]=false; a=true; return a; })() is true
PASS (function (a){'use strict'; arguments[0]=true; return arguments; })()[0] is true
PASS (function (){'use strict'; arguments[0]=true; return arguments; })()[0] is true
PASS (function (a){'use strict'; var local; (function (){local;})(); a = false; return a !== arguments[0]; })(true) is true
PASS (function (a){'use strict'; var local; (function (){local;})(); arguments[0] = false; return a !== arguments[0]; })(true) is true
PASS (function (a){'use strict'; var local; (function (){local;})(); a=false; return arguments; })(true)[0] is true
PASS (function (a){'use strict'; var local; (function (){local;})(); arguments[0]=false; return a; })(true) is true
PASS (function (a){'use strict'; var local; (function (){local;})(); arguments[0]=true; return arguments; })(false)[0] is true
PASS (function (){'use strict'; var local; (function (){local;})(); arguments[0]=true; return arguments; })(false)[0] is true
PASS (function (a){'use strict'; var local; (function (){local;})(); arguments[0]=true; a=false; return arguments; })()[0] is true
PASS (function (a){'use strict'; var local; (function (){local;})(); arguments[0]=true; return arguments; })()[0] is true
PASS (function (a){'use strict'; var local; (function (){local;})(); arguments[0]=false; a=true; return a; })() is true
PASS (function (){'use strict'; var local; (function (){local;})(); arguments[0]=true; return arguments; })()[0] is true
PASS 'use strict'; (function (){var a = true; eval('var a = false'); return a; })() is true
PASS (function (){var a = true; eval('"use strict"; var a = false'); return a; })() is true
PASS (function f(arg){'use strict'; return Object.getOwnPropertyDescriptor(f, 'arguments').value; })() is undefined.
PASS (function f(arg){'use strict'; return Object.getOwnPropertyDescriptor(f, 'caller').value; })() is undefined.
PASS (function f(arg){'use strict'; return Object.getOwnPropertyDescriptor(arguments, 'callee').value; })() is undefined.
PASS (function f(arg){'use strict'; return Object.getOwnPropertyDescriptor(arguments, 'caller').value; })() is undefined.
PASS (function f(arg){'use strict'; var descriptor = Object.getOwnPropertyDescriptor(arguments, 'caller'); return descriptor.get === descriptor.set; })() is true
PASS (function f(arg){'use strict'; var descriptor = Object.getOwnPropertyDescriptor(arguments, 'callee'); return descriptor.get === descriptor.set; })() is true
PASS (function f(arg){'use strict'; var descriptor = Object.getOwnPropertyDescriptor(f, 'caller'); return descriptor.get === descriptor.set; })() is true
PASS (function f(arg){'use strict'; var descriptor = Object.getOwnPropertyDescriptor(f, 'arguments'); return descriptor.get === descriptor.set; })() is true
PASS 'use strict'; (function f() { for(var i in this); })(); true; is true
PASS successfullyParsed is true
TEST COMPLETE