tizen beta release
[framework/web/webkit-efl.git] / LayoutTests / fast / js / basic-strict-mode-expected.txt
1 Test behaviour of strict mode
2
3 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
4
5
6 PASS testThis.call(null) is null
7 PASS testThis.call(1) is 1
8 PASS testThis.call(true) is true
9 PASS testThis.call(false) is false
10 PASS testThis.call(undefined) is undefined
11 PASS testLineContinuation.call(undefined) === undefined is false
12 PASS testEscapeSequence.call(undefined) === undefined is false
13 PASS testThis.call('a string') is 'a string'
14 PASS testThisDotAccess.call('a string') is 'a string'.length
15 PASS testThisDotAccess.call(null) threw exception TypeError: 'null' is not an object (evaluating 'this.length').
16 PASS testThisDotAccess.call(undefined) threw exception TypeError: 'undefined' is not an object (evaluating 'this.length').
17 PASS testThisDotAccess.call(true) is undefined.
18 PASS testThisDotAccess.call(false) is undefined.
19 PASS testThisDotAccess.call(1) is undefined.
20 PASS testThisBracketAccess.call('a string', 'length') is 'a string'.length
21 PASS testThisBracketAccess.call(null, 'length') threw exception TypeError: 'null' is not an object (evaluating 'this[prop]').
22 PASS testThisBracketAccess.call(undefined, 'length') threw exception TypeError: 'undefined' is not an object (evaluating 'this[prop]').
23 PASS testThisBracketAccess.call(true, 'length') is undefined.
24 PASS testThisBracketAccess.call(false, 'length') is undefined.
25 PASS testThisBracketAccess.call(1, 'length') is undefined.
26 PASS Function('"use strict"; return this;')() is undefined.
27 PASS Function('"use strict"; with({});') threw exception SyntaxError: 'with' statements are not valid in strict mode.
28 PASS testGlobalAccess() is undefined
29 PASS testThis.call() is undefined
30 PASS testThis.apply() is undefined
31 PASS testThis.call(undefined) is undefined
32 PASS testThis.apply(undefined) is undefined
33 PASS (function eval(){'use strict';}) threw exception SyntaxError: Unexpected token '}'.
34 PASS (function(){(function eval(){'use strict';})}) threw exception SyntaxError: Unexpected token '}'.
35 PASS (function (eval){'use strict';}) threw exception SyntaxError: Unexpected token '}'.
36 PASS (function(){(function (eval){'use strict';})}) threw exception SyntaxError: Unexpected token '}'.
37 PASS (function arguments(){'use strict';}) threw exception SyntaxError: Unexpected token '}'.
38 PASS (function(){(function arguments(){'use strict';})}) threw exception SyntaxError: Unexpected token '}'.
39 PASS (function (arguments){'use strict';}) threw exception SyntaxError: Unexpected token '}'.
40 PASS (function(){(function (arguments){'use strict';})}) threw exception SyntaxError: Unexpected token '}'.
41 PASS (function (){'use strict'; var eval;}) threw exception SyntaxError: Cannot declare a variable named 'eval' in strict mode..
42 PASS (function(){(function (){'use strict'; var eval;})}) threw exception SyntaxError: Cannot declare a variable named 'eval' in strict mode..
43 PASS (function (){'use strict'; var arguments;}) threw exception SyntaxError: Cannot declare a variable named 'arguments' in strict mode..
44 PASS (function(){(function (){'use strict'; var arguments;})}) threw exception SyntaxError: Cannot declare a variable named 'arguments' in strict mode..
45 PASS (function (){'use strict'; try{}catch(eval){}}) threw exception SyntaxError: Cannot declare a variable named 'eval' in strict mode.
46 PASS (function(){(function (){'use strict'; try{}catch(eval){}})}) threw exception SyntaxError: Cannot declare a variable named 'eval' in strict mode.
47 PASS (function (){'use strict'; try{}catch(arguments){}}) threw exception SyntaxError: Cannot declare a variable named 'arguments' in strict mode.
48 PASS (function(){(function (){'use strict'; try{}catch(arguments){}})}) threw exception SyntaxError: Cannot declare a variable named 'arguments' in strict mode.
49 PASS (function (a, a){'use strict';}) threw exception SyntaxError: Unexpected token '}'.
50 PASS (function(){(function (a, a){'use strict';})}) threw exception SyntaxError: Unexpected token '}'.
51 PASS (function (a){'use strict'; delete a;})() threw exception SyntaxError: Cannot delete unqualified property 'a' in strict mode.
52 PASS (function(){(function (a){'use strict'; delete a;})()}) threw exception SyntaxError: Cannot delete unqualified property 'a' in strict mode.
53 PASS (function (){'use strict'; var a; delete a;})() threw exception SyntaxError: Cannot delete unqualified property 'a' in strict mode.
54 PASS (function(){(function (){'use strict'; var a; delete a;})()}) threw exception SyntaxError: Cannot delete unqualified property 'a' in strict mode.
55 PASS (function (){var a; function f() {'use strict'; delete a;} })() threw exception SyntaxError: Cannot delete unqualified property 'a' in strict mode.
56 PASS (function(){(function (){var a; function f() {'use strict'; delete a;} })()}) threw exception SyntaxError: Cannot delete unqualified property 'a' in strict mode.
57 PASS (function (){'use strict'; with(1){};}) threw exception SyntaxError: 'with' statements are not valid in strict mode.
58 PASS (function(){(function (){'use strict'; with(1){};})}) threw exception SyntaxError: 'with' statements are not valid in strict mode.
59 PASS (function (){'use strict'; arguments.callee; })() threw exception TypeError: Unable to access callee of strict mode function.
60 PASS (function (){'use strict'; arguments.caller; })() threw exception TypeError: Unable to access caller of strict mode function.
61 PASS (function f(){'use strict'; f.arguments; })() threw exception TypeError: Type error.
62 PASS (function f(){'use strict'; f.caller; })() threw exception TypeError: Type error.
63 PASS (function f(){'use strict'; f.arguments=5; })() threw exception TypeError: Type error.
64 PASS (function f(){'use strict'; f.caller=5; })() threw exception TypeError: Type error.
65 PASS (function (arg){'use strict'; arguments.callee; })() threw exception TypeError: Unable to access callee of strict mode function.
66 PASS (function (arg){'use strict'; arguments.caller; })() threw exception TypeError: Unable to access caller of strict mode function.
67 PASS (function f(arg){'use strict'; f.arguments; })() threw exception TypeError: Type error.
68 PASS (function f(arg){'use strict'; f.caller; })() threw exception TypeError: Type error.
69 PASS (function f(arg){'use strict'; f.arguments=5; })() threw exception TypeError: Type error.
70 PASS (function f(arg){'use strict'; f.caller=5; })() threw exception TypeError: Type error.
71 PASS "caller" in function(){"use strict"} is true
72 PASS (function(){"use strict";}).hasOwnProperty("caller") is true
73 PASS "arguments" in function(){"use strict"} is true
74 PASS (function(){"use strict";}).hasOwnProperty("arguments") is true
75 PASS 'use strict'; (function (){with(1){};}) threw exception SyntaxError: 'with' statements are not valid in strict mode.
76 PASS (function(){'use strict'; (function (){with(1){};})}) threw exception SyntaxError: 'with' statements are not valid in strict mode.
77 PASS 'use strict'; (function (){var a; delete a;}) threw exception SyntaxError: Cannot delete unqualified property 'a' in strict mode.
78 PASS (function(){'use strict'; (function (){var a; delete a;})}) threw exception SyntaxError: Cannot delete unqualified property 'a' in strict mode.
79 PASS 'use strict'; var a; (function (){ delete a;}) threw exception SyntaxError: Cannot delete unqualified property 'a' in strict mode.
80 PASS (function(){'use strict'; var a; (function (){ delete a;})}) threw exception SyntaxError: Cannot delete unqualified property 'a' in strict mode.
81 PASS var a; (function (){ 'use strict'; delete a;}) threw exception SyntaxError: Cannot delete unqualified property 'a' in strict mode.
82 PASS (function(){var a; (function (){ 'use strict'; delete a;})}) threw exception SyntaxError: Cannot delete unqualified property 'a' in strict mode.
83 PASS 'misc directive'; 'use strict'; with({}){} threw exception SyntaxError: 'with' statements are not valid in strict mode.
84 PASS (function(){'misc directive'; 'use strict'; with({}){}}) threw exception SyntaxError: 'with' statements are not valid in strict mode.
85 PASS 'use strict'; return threw exception SyntaxError: Return statements are only valid inside functions.
86 PASS 'use strict'; break threw exception SyntaxError: 'break' is only valid inside a switch or loop statement.
87 PASS (function(){'use strict'; break}) threw exception SyntaxError: 'break' is only valid inside a switch or loop statement.
88 PASS 'use strict'; continue threw exception SyntaxError: 'continue' is only valid inside a loop statement.
89 PASS (function(){'use strict'; continue}) threw exception SyntaxError: 'continue' is only valid inside a loop statement.
90 PASS 'use strict'; for(;;)return threw exception SyntaxError: Return statements are only valid inside functions.
91 PASS 'use strict'; for(;;)break missingLabel threw exception SyntaxError: Label 'missingLabel' is not defined.
92 PASS (function(){'use strict'; for(;;)break missingLabel}) threw exception SyntaxError: Label 'missingLabel' is not defined.
93 PASS 'use strict'; for(;;)continue missingLabel threw exception SyntaxError: Label 'missingLabel' is not defined.
94 PASS (function(){'use strict'; for(;;)continue missingLabel}) threw exception SyntaxError: Label 'missingLabel' is not defined.
95 PASS 'use strict'; 007; threw exception SyntaxError: Octal escapes are forbidden in strict mode.
96 PASS (function(){'use strict'; 007;}) threw exception SyntaxError: Octal escapes are forbidden in strict mode.
97 PASS 'use strict'; '\007'; threw exception SyntaxError: The only valid numeric escape in strict mode is '\0'.
98 PASS (function(){'use strict'; '\007';}) threw exception SyntaxError: The only valid numeric escape in strict mode is '\0'.
99 PASS '\007'; 'use strict'; threw exception SyntaxError: The only valid numeric escape in strict mode is '\0'.
100 PASS (function(){'\007'; 'use strict';}) threw exception SyntaxError: The only valid numeric escape in strict mode is '\0'.
101 PASS 'use strict'; delete aDeletableProperty; threw exception SyntaxError: Cannot delete unqualified property 'aDeletableProperty' in strict mode.
102 PASS (function(){'use strict'; delete aDeletableProperty;}) threw exception SyntaxError: Cannot delete unqualified property 'aDeletableProperty' in strict mode.
103 PASS 'use strict'; (function (){ delete someDeclaredGlobal;}) threw exception SyntaxError: Cannot delete unqualified property 'someDeclaredGlobal' in strict mode.
104 PASS (function(){'use strict'; (function (){ delete someDeclaredGlobal;})}) threw exception SyntaxError: Cannot delete unqualified property 'someDeclaredGlobal' in strict mode.
105 PASS (function (){ 'use strict'; delete someDeclaredGlobal;}) threw exception SyntaxError: Cannot delete unqualified property 'someDeclaredGlobal' in strict mode.
106 PASS (function(){(function (){ 'use strict'; delete someDeclaredGlobal;})}) threw exception SyntaxError: Cannot delete unqualified property 'someDeclaredGlobal' in strict mode.
107 PASS 'use strict'; if (0) { someGlobal = 'Shouldn\'t be able to assign this.'; }; true; is true
108 PASS 'use strict'; someGlobal = 'Shouldn\'t be able to assign this.';  threw exception ReferenceError: Strict mode forbids implicit creation of global property 'someGlobal'.
109 PASS 'use strict'; (function f(){ f = 'shouldn\'t be able to assign to function expression name'; })() threw exception TypeError: Attempted to assign to readonly property..
110 PASS 'use strict'; eval('var introducedVariable = "FAIL: variable introduced into containing scope";'); introducedVariable threw exception ReferenceError: Can't find variable: introducedVariable.
111 PASS 'use strict'; objectWithReadonlyProperty.prop = 'fail' threw exception TypeError: Attempted to assign to readonly property..
112 PASS 'use strict'; delete objectWithReadonlyProperty.prop threw exception TypeError: Unable to delete property..
113 PASS 'use strict'; delete objectWithReadonlyProperty[readonlyPropName] threw exception TypeError: Unable to delete property..
114 PASS 'use strict'; ++eval threw exception SyntaxError: ' 'eval' ' cannot be modified in strict mode.
115 PASS (function(){'use strict'; ++eval}) threw exception SyntaxError: ' 'eval' ' cannot be modified in strict mode.
116 PASS 'use strict'; eval++ threw exception SyntaxError: ' 'eval' ' cannot be modified in strict mode.
117 PASS (function(){'use strict'; eval++}) threw exception SyntaxError: ' 'eval' ' cannot be modified in strict mode.
118 PASS 'use strict'; --eval threw exception SyntaxError: ' 'eval' ' cannot be modified in strict mode.
119 PASS (function(){'use strict'; --eval}) threw exception SyntaxError: ' 'eval' ' cannot be modified in strict mode.
120 PASS 'use strict'; eval-- threw exception SyntaxError: ' 'eval' ' cannot be modified in strict mode.
121 PASS (function(){'use strict'; eval--}) threw exception SyntaxError: ' 'eval' ' cannot be modified in strict mode.
122 PASS 'use strict'; function f() { ++arguments } threw exception SyntaxError: ' 'arguments' ' cannot be modified in strict mode.
123 PASS (function(){'use strict'; function f() { ++arguments }}) threw exception SyntaxError: ' 'arguments' ' cannot be modified in strict mode.
124 PASS 'use strict'; function f() { arguments++ } threw exception SyntaxError: ' 'arguments' ' cannot be modified in strict mode.
125 PASS (function(){'use strict'; function f() { arguments++ }}) threw exception SyntaxError: ' 'arguments' ' cannot be modified in strict mode.
126 PASS 'use strict'; function f() { --arguments } threw exception SyntaxError: ' 'arguments' ' cannot be modified in strict mode.
127 PASS (function(){'use strict'; function f() { --arguments }}) threw exception SyntaxError: ' 'arguments' ' cannot be modified in strict mode.
128 PASS 'use strict'; function f() { arguments-- } threw exception SyntaxError: ' 'arguments' ' cannot be modified in strict mode.
129 PASS (function(){'use strict'; function f() { arguments-- }}) threw exception SyntaxError: ' 'arguments' ' cannot be modified in strict mode.
130 PASS global.eval('"use strict"; if (0) ++arguments; true;') threw exception SyntaxError: ' 'arguments' ' cannot be modified in strict mode.
131 PASS 'use strict'; ++(1, eval) threw exception ReferenceError: Prefix ++ operator applied to value that is not a reference..
132 PASS (function(){'use strict'; ++(1, eval)}) threw exception SyntaxError: ' 'eval' ' cannot be modified in strict mode.
133 PASS 'use strict'; (1, eval)++ threw exception ReferenceError: Postfix ++ operator applied to value that is not a reference..
134 PASS (function(){'use strict'; (1, eval)++}) threw exception SyntaxError: ' 'eval' ' cannot be modified in strict mode.
135 PASS 'use strict'; --(1, eval) threw exception ReferenceError: Prefix -- operator applied to value that is not a reference..
136 PASS (function(){'use strict'; --(1, eval)}) threw exception SyntaxError: ' 'eval' ' cannot be modified in strict mode.
137 PASS 'use strict'; (1, eval)-- threw exception ReferenceError: Postfix -- operator applied to value that is not a reference..
138 PASS (function(){'use strict'; (1, eval)--}) threw exception SyntaxError: ' 'eval' ' cannot be modified in strict mode.
139 PASS 'use strict'; function f() { ++(1, arguments) } threw exception SyntaxError: ' 'arguments' ' cannot be modified in strict mode.
140 PASS (function(){'use strict'; function f() { ++(1, arguments) }}) threw exception SyntaxError: ' 'arguments' ' cannot be modified in strict mode.
141 PASS 'use strict'; function f() { (1, arguments)++ } threw exception SyntaxError: ' 'arguments' ' cannot be modified in strict mode.
142 PASS (function(){'use strict'; function f() { (1, arguments)++ }}) threw exception SyntaxError: ' 'arguments' ' cannot be modified in strict mode.
143 PASS 'use strict'; function f() { --(1, arguments) } threw exception SyntaxError: ' 'arguments' ' cannot be modified in strict mode.
144 PASS (function(){'use strict'; function f() { --(1, arguments) }}) threw exception SyntaxError: ' 'arguments' ' cannot be modified in strict mode.
145 PASS 'use strict'; function f() { (1, arguments)-- } threw exception SyntaxError: ' 'arguments' ' cannot be modified in strict mode.
146 PASS (function(){'use strict'; function f() { (1, arguments)-- }}) threw exception SyntaxError: ' 'arguments' ' cannot be modified in strict mode.
147 PASS 'use strict'; if (0) delete +a.b threw exception SyntaxError: Unexpected token '+'.
148 PASS (function(){'use strict'; if (0) delete +a.b}) threw exception SyntaxError: Unexpected token '+'.
149 PASS 'use strict'; if (0) delete ++a.b threw exception SyntaxError: Unexpected token '++'.
150 PASS (function(){'use strict'; if (0) delete ++a.b}) threw exception SyntaxError: Unexpected token '++'.
151 PASS 'use strict'; if (0) delete void a.b threw exception SyntaxError: Unexpected token 'void'.
152 PASS (function(){'use strict'; if (0) delete void a.b}) threw exception SyntaxError: Unexpected token 'void'.
153 PASS (function (a){'use strict'; a = false; return a !== arguments[0]; })(true) is true
154 PASS (function (a){'use strict'; arguments[0] = false; return a !== arguments[0]; })(true) is true
155 PASS (function (a){'use strict'; a=false; return arguments; })(true)[0] is true
156 PASS (function (a){'use strict'; arguments[0]=false; return a; })(true) is true
157 PASS (function (a){'use strict'; arguments[0]=true; return arguments; })(false)[0] is true
158 PASS (function (){'use strict';  arguments[0]=true; return arguments; })(false)[0] is true
159 PASS (function (a){'use strict'; arguments[0]=true; a=false; return arguments; })()[0] is true
160 PASS (function (a){'use strict'; arguments[0]=false; a=true; return a; })() is true
161 PASS (function (a){'use strict'; arguments[0]=true; return arguments; })()[0] is true
162 PASS (function (){'use strict';  arguments[0]=true; return arguments; })()[0] is true
163 PASS (function (a){'use strict'; var local; (function (){local;})(); a = false; return a !== arguments[0]; })(true) is true
164 PASS (function (a){'use strict'; var local; (function (){local;})(); arguments[0] = false; return a !== arguments[0]; })(true) is true
165 PASS (function (a){'use strict'; var local; (function (){local;})(); a=false; return arguments; })(true)[0] is true
166 PASS (function (a){'use strict'; var local; (function (){local;})(); arguments[0]=false; return a; })(true) is true
167 PASS (function (a){'use strict'; var local; (function (){local;})(); arguments[0]=true; return arguments; })(false)[0] is true
168 PASS (function (){'use strict';  var local; (function (){local;})(); arguments[0]=true; return arguments; })(false)[0] is true
169 PASS (function (a){'use strict'; var local; (function (){local;})(); arguments[0]=true; a=false; return arguments; })()[0] is true
170 PASS (function (a){'use strict'; var local; (function (){local;})(); arguments[0]=true; return arguments; })()[0] is true
171 PASS (function (a){'use strict'; var local; (function (){local;})(); arguments[0]=false; a=true; return a; })() is true
172 PASS (function (){'use strict';  var local; (function (){local;})(); arguments[0]=true; return arguments; })()[0] is true
173 PASS 'use strict'; (function (){var a = true; eval('var a = false'); return a; })() is true
174 PASS (function (){var a = true; eval('"use strict"; var a = false'); return a; })() is true
175 PASS (function f(arg){'use strict'; return Object.getOwnPropertyDescriptor(f, 'arguments').value; })() is undefined.
176 PASS (function f(arg){'use strict'; return Object.getOwnPropertyDescriptor(f, 'caller').value; })() is undefined.
177 PASS (function f(arg){'use strict'; return Object.getOwnPropertyDescriptor(arguments, 'callee').value; })() is undefined.
178 PASS (function f(arg){'use strict'; return Object.getOwnPropertyDescriptor(arguments, 'caller').value; })() is undefined.
179 PASS (function f(arg){'use strict'; var descriptor = Object.getOwnPropertyDescriptor(arguments, 'caller'); return descriptor.get === descriptor.set; })() is true
180 PASS (function f(arg){'use strict'; var descriptor = Object.getOwnPropertyDescriptor(arguments, 'callee'); return descriptor.get === descriptor.set; })() is true
181 PASS (function f(arg){'use strict'; var descriptor = Object.getOwnPropertyDescriptor(f, 'caller'); return descriptor.get === descriptor.set; })() is true
182 PASS (function f(arg){'use strict'; var descriptor = Object.getOwnPropertyDescriptor(f, 'arguments'); return descriptor.get === descriptor.set; })() is true
183 PASS 'use strict'; (function f() { for(var i in this); })(); true; is true
184 PASS 'use strict'̻ threw exception SyntaxError: Invalid character '\u0827'.
185 PASS (function(){'use strict'̻}) threw exception SyntaxError: Invalid character '\u0827'.
186 PASS 'use strict'5.f threw exception SyntaxError: At least one digit must occur after a decimal point.
187 PASS (function(){'use strict'5.f}) threw exception SyntaxError: At least one digit must occur after a decimal point.
188 PASS 'use strict';̻ threw exception SyntaxError: Invalid character '\u0827'.
189 PASS (function(){'use strict';̻}) threw exception SyntaxError: Invalid character '\u0827'.
190 PASS 'use strict';5.f threw exception SyntaxError: At least one digit must occur after a decimal point.
191 PASS (function(){'use strict';5.f}) threw exception SyntaxError: At least one digit must occur after a decimal point.
192 PASS 'use strict';1-(eval=1); threw exception SyntaxError: 'eval' cannot be modified in strict mode.
193 PASS (function(){'use strict';1-(eval=1);}) threw exception SyntaxError: 'eval' cannot be modified in strict mode.
194 PASS 'use strict';arguments=1; threw exception SyntaxError: 'arguments' cannot be modified in strict mode.
195 PASS (function(){'use strict';arguments=1;}) threw exception SyntaxError: 'arguments' cannot be modified in strict mode.
196 PASS 'use strict';1-(arguments=1); threw exception SyntaxError: 'arguments' cannot be modified in strict mode.
197 PASS (function(){'use strict';1-(arguments=1);}) threw exception SyntaxError: 'arguments' cannot be modified in strict mode.
198 PASS 'use strict';var a=(eval=1); threw exception SyntaxError: 'eval' cannot be modified in strict mode.
199 PASS (function(){'use strict';var a=(eval=1);}) threw exception SyntaxError: 'eval' cannot be modified in strict mode.
200 PASS 'use strict';var a=(arguments=1); threw exception SyntaxError: 'arguments' cannot be modified in strict mode.
201 PASS (function(){'use strict';var a=(arguments=1);}) threw exception SyntaxError: 'arguments' cannot be modified in strict mode.
202 PASS 'use strict'; try { throw 1; } catch (e) { aGlobal = true; } is true
203 PASS 'use strict'; (function () { try { throw 1; } catch (e) { aGlobal = true; }})(); aGlobal; is true
204 PASS (function () {'use strict';  try { throw 1; } catch (e) { aGlobal = true; }})(); aGlobal; is true
205 PASS try { throw 1; } catch (e) { aGlobal = true; } is true
206 PASS (function () { try { throw 1; } catch (e) { aGlobal = true; }})(); aGlobal; is true
207 PASS (function () {try { throw 1; } catch (e) { aGlobal = true; }})(); aGlobal; is true
208 PASS successfullyParsed is true
209
210 TEST COMPLETE
211