Upstream version 11.40.277.0
[platform/framework/web/crosswalk.git] / src / v8 / test / mjsunit / strict-mode.js
1 // Copyright 2011 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are
4 // met:
5 //
6 //     * Redistributions of source code must retain the above copyright
7 //       notice, this list of conditions and the following disclaimer.
8 //     * Redistributions in binary form must reproduce the above
9 //       copyright notice, this list of conditions and the following
10 //       disclaimer in the documentation and/or other materials provided
11 //       with the distribution.
12 //     * Neither the name of Google Inc. nor the names of its
13 //       contributors may be used to endorse or promote products derived
14 //       from this software without specific prior written permission.
15 //
16 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
17 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
18 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
19 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
20 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
21 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
22 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27
28 // Flags: --turbo-deoptimization
29
30 function CheckStrictMode(code, exception) {
31   assertDoesNotThrow(code);
32   assertThrows("'use strict';\n" + code, exception);
33   assertThrows('"use strict";\n' + code, exception);
34   assertDoesNotThrow("\
35     function outer() {\
36       function inner() {\n"
37         + code +
38       "\n}\
39     }");
40   assertThrows("\
41     function outer() {\
42       'use strict';\
43       function inner() {\n"
44         + code +
45       "\n}\
46     }", exception);
47 }
48
49 function CheckFunctionConstructorStrictMode() {
50   var args = [];
51   for (var i = 0; i < arguments.length; i ++) {
52     args[i] = arguments[i];
53   }
54   // Create non-strict function. No exception.
55   args[arguments.length] = "";
56   assertDoesNotThrow(function() {
57     Function.apply(this, args);
58   });
59   // Create strict mode function. Exception expected.
60   args[arguments.length] = "'use strict';";
61   assertThrows(function() {
62     Function.apply(this, args);
63   }, SyntaxError);
64 }
65
66 // Incorrect 'use strict' directive.
67 (function UseStrictEscape() {
68   "use\\x20strict";
69   with ({}) {};
70 })();
71
72 // Incorrectly place 'use strict' directive.
73 assertThrows("function foo (x) 'use strict'; {}", SyntaxError);
74
75 // 'use strict' in non-directive position.
76 (function UseStrictNonDirective() {
77   void(0);
78   "use strict";
79   with ({}) {};
80 })();
81
82 // Multiple directives, including "use strict".
83 assertThrows('\
84 "directive 1";\
85 "another directive";\
86 "use strict";\
87 "directive after strict";\
88 "and one more";\
89 with({}) {}', SyntaxError);
90
91 // 'with' disallowed in strict mode.
92 CheckStrictMode("with({}) {}", SyntaxError);
93
94 // Function named 'eval'.
95 CheckStrictMode("function eval() {}", SyntaxError);
96
97 // Function named 'arguments'.
98 CheckStrictMode("function arguments() {}", SyntaxError);
99
100 // Function parameter named 'eval'.
101 CheckStrictMode("function foo(a, b, eval, c, d) {}", SyntaxError);
102
103 // Function parameter named 'arguments'.
104 CheckStrictMode("function foo(a, b, arguments, c, d) {}", SyntaxError);
105
106 // Property accessor parameter named 'eval'.
107 CheckStrictMode("var o = { set foo(eval) {} }", SyntaxError);
108
109 // Property accessor parameter named 'arguments'.
110 CheckStrictMode("var o = { set foo(arguments) {} }", SyntaxError);
111
112 // Duplicate function parameter name.
113 CheckStrictMode("function foo(a, b, c, d, b) {}", SyntaxError);
114
115 // Function constructor: eval parameter name.
116 CheckFunctionConstructorStrictMode("eval");
117
118 // Function constructor: arguments parameter name.
119 CheckFunctionConstructorStrictMode("arguments");
120
121 // Function constructor: duplicate parameter name.
122 CheckFunctionConstructorStrictMode("a", "b", "c", "b");
123 CheckFunctionConstructorStrictMode("a,b,c,b");
124
125 // catch(eval)
126 CheckStrictMode("try{}catch(eval){};", SyntaxError);
127
128 // catch(arguments)
129 CheckStrictMode("try{}catch(arguments){};", SyntaxError);
130
131 // var eval
132 CheckStrictMode("var eval;", SyntaxError);
133
134 // var arguments
135 CheckStrictMode("var arguments;", SyntaxError);
136
137 // Strict mode applies to the function in which the directive is used..
138 assertThrows('\
139 function foo(eval) {\
140   "use strict";\
141 }', SyntaxError);
142
143 // Strict mode doesn't affect the outer stop of strict code.
144 (function NotStrict(eval) {
145   function Strict() {
146     "use strict";
147   }
148   with ({}) {};
149 })();
150
151 // Octal literal
152 CheckStrictMode("var x = 012");
153 CheckStrictMode("012");
154 CheckStrictMode("'Hello octal\\032'");
155 CheckStrictMode("function octal() { return 012; }");
156 CheckStrictMode("function octal() { return '\\032'; }");
157
158 (function ValidEscape() {
159   "use strict";
160   var x = '\0';
161   var y = "\0";
162 })();
163
164 // Octal before "use strict"
165 assertThrows('\
166   function strict() {\
167     "octal\\032directive";\
168     "use strict";\
169   }', SyntaxError);
170
171 // Duplicate data properties.
172 CheckStrictMode("var x = { dupe : 1, nondupe: 3, dupe : 2 };", SyntaxError);
173 CheckStrictMode("var x = { '1234' : 1, '2345' : 2, '1234' : 3 };", SyntaxError);
174 CheckStrictMode("var x = { '1234' : 1, '2345' : 2, 1234 : 3 };", SyntaxError);
175 CheckStrictMode("var x = { 3.14 : 1, 2.71 : 2, 3.14 : 3 };", SyntaxError);
176 CheckStrictMode("var x = { 3.14 : 1, '3.14' : 2 };", SyntaxError);
177 CheckStrictMode("var x = { \
178   123: 1, \
179   123.00000000000000000000000000000000000000000000000000000000000000000001: 2 \
180 }", SyntaxError);
181
182 // Non-conflicting data properties.
183 (function StrictModeNonDuplicate() {
184   "use strict";
185   var x = { 123 : 1, "0123" : 2 };
186   var x = {
187     123: 1,
188     '123.00000000000000000000000000000000000000000000000000000000000000000001':
189       2
190   };
191 })();
192
193 // Two getters (non-strict)
194 assertThrows("var x = { get foo() { }, get foo() { } };", SyntaxError);
195 assertThrows("var x = { get foo(){}, get 'foo'(){}};", SyntaxError);
196 assertThrows("var x = { get 12(){}, get '12'(){}};", SyntaxError);
197
198 // Two setters (non-strict)
199 assertThrows("var x = { set foo(v) { }, set foo(v) { } };", SyntaxError);
200 assertThrows("var x = { set foo(v) { }, set 'foo'(v) { } };", SyntaxError);
201 assertThrows("var x = { set 13(v) { }, set '13'(v) { } };", SyntaxError);
202
203 // Setter and data (non-strict)
204 assertThrows("var x = { foo: 'data', set foo(v) { } };", SyntaxError);
205 assertThrows("var x = { set foo(v) { }, foo: 'data' };", SyntaxError);
206 assertThrows("var x = { foo: 'data', set 'foo'(v) { } };", SyntaxError);
207 assertThrows("var x = { set foo(v) { }, 'foo': 'data' };", SyntaxError);
208 assertThrows("var x = { 'foo': 'data', set foo(v) { } };", SyntaxError);
209 assertThrows("var x = { set 'foo'(v) { }, foo: 'data' };", SyntaxError);
210 assertThrows("var x = { 'foo': 'data', set 'foo'(v) { } };", SyntaxError);
211 assertThrows("var x = { set 'foo'(v) { }, 'foo': 'data' };", SyntaxError);
212 assertThrows("var x = { 12: 1, set '12'(v){}};", SyntaxError);
213 assertThrows("var x = { 12: 1, set 12(v){}};", SyntaxError);
214 assertThrows("var x = { '12': 1, set '12'(v){}};", SyntaxError);
215 assertThrows("var x = { '12': 1, set 12(v){}};", SyntaxError);
216
217 // Getter and data (non-strict)
218 assertThrows("var x = { foo: 'data', get foo() { } };", SyntaxError);
219 assertThrows("var x = { get foo() { }, foo: 'data' };", SyntaxError);
220 assertThrows("var x = { 'foo': 'data', get foo() { } };", SyntaxError);
221 assertThrows("var x = { get 'foo'() { }, 'foo': 'data' };", SyntaxError);
222 assertThrows("var x = { '12': 1, get '12'(){}};", SyntaxError);
223 assertThrows("var x = { '12': 1, get 12(){}};", SyntaxError);
224
225 // Assignment to eval or arguments
226 CheckStrictMode("function strict() { eval = undefined; }", SyntaxError);
227 CheckStrictMode("function strict() { arguments = undefined; }", SyntaxError);
228 CheckStrictMode("function strict() { print(eval = undefined); }", SyntaxError);
229 CheckStrictMode("function strict() { print(arguments = undefined); }",
230                 SyntaxError);
231 CheckStrictMode("function strict() { var x = eval = undefined; }", SyntaxError);
232 CheckStrictMode("function strict() { var x = arguments = undefined; }",
233                 SyntaxError);
234
235 // Compound assignment to eval or arguments
236 CheckStrictMode("function strict() { eval *= undefined; }", SyntaxError);
237 CheckStrictMode("function strict() { arguments /= undefined; }", SyntaxError);
238 CheckStrictMode("function strict() { print(eval %= undefined); }", SyntaxError);
239 CheckStrictMode("function strict() { print(arguments %= undefined); }",
240                 SyntaxError);
241 CheckStrictMode("function strict() { var x = eval += undefined; }",
242                 SyntaxError);
243 CheckStrictMode("function strict() { var x = arguments -= undefined; }",
244                 SyntaxError);
245 CheckStrictMode("function strict() { eval <<= undefined; }", SyntaxError);
246 CheckStrictMode("function strict() { arguments >>= undefined; }", SyntaxError);
247 CheckStrictMode("function strict() { print(eval >>>= undefined); }",
248                 SyntaxError);
249 CheckStrictMode("function strict() { print(arguments &= undefined); }",
250                 SyntaxError);
251 CheckStrictMode("function strict() { var x = eval ^= undefined; }",
252                 SyntaxError);
253 CheckStrictMode("function strict() { var x = arguments |= undefined; }",
254                 SyntaxError);
255
256 // Postfix increment with eval or arguments
257 CheckStrictMode("function strict() { eval++; }", SyntaxError);
258 CheckStrictMode("function strict() { arguments++; }", SyntaxError);
259 CheckStrictMode("function strict() { print(eval++); }", SyntaxError);
260 CheckStrictMode("function strict() { print(arguments++); }", SyntaxError);
261 CheckStrictMode("function strict() { var x = eval++; }", SyntaxError);
262 CheckStrictMode("function strict() { var x = arguments++; }", SyntaxError);
263
264 // Postfix decrement with eval or arguments
265 CheckStrictMode("function strict() { eval--; }", SyntaxError);
266 CheckStrictMode("function strict() { arguments--; }", SyntaxError);
267 CheckStrictMode("function strict() { print(eval--); }", SyntaxError);
268 CheckStrictMode("function strict() { print(arguments--); }", SyntaxError);
269 CheckStrictMode("function strict() { var x = eval--; }", SyntaxError);
270 CheckStrictMode("function strict() { var x = arguments--; }", SyntaxError);
271
272 // Prefix increment with eval or arguments
273 CheckStrictMode("function strict() { ++eval; }", SyntaxError);
274 CheckStrictMode("function strict() { ++arguments; }", SyntaxError);
275 CheckStrictMode("function strict() { print(++eval); }", SyntaxError);
276 CheckStrictMode("function strict() { print(++arguments); }", SyntaxError);
277 CheckStrictMode("function strict() { var x = ++eval; }", SyntaxError);
278 CheckStrictMode("function strict() { var x = ++arguments; }", SyntaxError);
279
280 // Prefix decrement with eval or arguments
281 CheckStrictMode("function strict() { --eval; }", SyntaxError);
282 CheckStrictMode("function strict() { --arguments; }", SyntaxError);
283 CheckStrictMode("function strict() { print(--eval); }", SyntaxError);
284 CheckStrictMode("function strict() { print(--arguments); }", SyntaxError);
285 CheckStrictMode("function strict() { var x = --eval; }", SyntaxError);
286 CheckStrictMode("function strict() { var x = --arguments; }", SyntaxError);
287
288 // Use of const in strict mode is disallowed in anticipation of ES Harmony.
289 CheckStrictMode("const x = 0;", SyntaxError);
290 CheckStrictMode("for (const x = 0; false;) {}", SyntaxError);
291 CheckStrictMode("function strict() { const x = 0; }", SyntaxError);
292
293 // Strict mode only allows functions in SourceElements
294 CheckStrictMode("if (true) { function invalid() {} }", SyntaxError);
295 CheckStrictMode("for (;false;) { function invalid() {} }", SyntaxError);
296 CheckStrictMode("{ function invalid() {} }", SyntaxError);
297 CheckStrictMode("try { function invalid() {} } catch(e) {}", SyntaxError);
298 CheckStrictMode("try { } catch(e) { function invalid() {} }", SyntaxError);
299 CheckStrictMode("function outer() {{ function invalid() {} }}", SyntaxError);
300
301 // Delete of an unqualified identifier
302 CheckStrictMode("delete unqualified;", SyntaxError);
303 CheckStrictMode("function strict() { delete unqualified; }", SyntaxError);
304 CheckStrictMode("function function_name() { delete function_name; }",
305                 SyntaxError);
306 CheckStrictMode("function strict(parameter) { delete parameter; }",
307                 SyntaxError);
308 CheckStrictMode("function strict() { var variable; delete variable; }",
309                 SyntaxError);
310 CheckStrictMode("var variable; delete variable;", SyntaxError);
311
312 (function TestStrictDelete() {
313   "use strict";
314   // "delete this" is allowed in strict mode and should work.
315   function strict_delete() { delete this; }
316   strict_delete();
317 })();
318
319 // Prefix unary operators other than delete, ++, -- are valid in strict mode
320 (function StrictModeUnaryOperators() {
321   "use strict";
322   var x = [void eval, typeof eval, +eval, -eval, ~eval, !eval];
323   var y = [void arguments, typeof arguments,
324            +arguments, -arguments, ~arguments, !arguments];
325 })();
326
327 // 7.6.1.2 Future Reserved Words in strict mode
328 var future_strict_reserved_words = [
329   "implements",
330   "interface",
331   "let",
332   "package",
333   "private",
334   "protected",
335   "public",
336   "static",
337   "yield" ];
338
339 function testFutureStrictReservedWord(word) {
340   // Simple use of each reserved word
341   CheckStrictMode("var " + word + " = 1;", SyntaxError);
342   CheckStrictMode("typeof (" + word + ");", SyntaxError);
343
344   // object literal properties
345   eval("var x = { " + word + " : 42 };");
346   eval("var x = { get " + word + " () {} };");
347   eval("var x = { set " + word + " (value) {} };");
348   eval("var x = { get " + word + " () { 'use strict'; } };");
349   eval("var x = { set " + word + " (value) { 'use strict'; } };");
350
351   // object literal with string literal property names
352   eval("var x = { '" + word + "' : 42 };");
353   eval("var x = { get '" + word + "' () { } };");
354   eval("var x = { set '" + word + "' (value) { } };");
355   eval("var x = { get '" + word + "' () { 'use strict'; } };");
356   eval("var x = { set '" + word + "' (value) { 'use strict'; } };");
357
358   // Function names and arguments, strict and non-strict contexts
359   CheckStrictMode("function " + word + " () {}", SyntaxError);
360   CheckStrictMode("function foo (" + word + ") {}", SyntaxError);
361   CheckStrictMode("function foo (" + word + ", " + word + ") {}", SyntaxError);
362   CheckStrictMode("function foo (a, " + word + ") {}", SyntaxError);
363   CheckStrictMode("function foo (" + word + ", a) {}", SyntaxError);
364   CheckStrictMode("function foo (a, " + word + ", b) {}", SyntaxError);
365   CheckStrictMode("var foo = function (" + word + ") {}", SyntaxError);
366
367   // Function names and arguments when the body is strict
368   assertThrows("function " + word + " () { 'use strict'; }", SyntaxError);
369   assertThrows("function foo (" + word + ", " + word + ") { 'use strict'; }",
370                SyntaxError);
371   assertThrows("function foo (a, " + word + ") { 'use strict'; }", SyntaxError);
372   assertThrows("function foo (" + word + ", a) { 'use strict'; }", SyntaxError);
373   assertThrows("function foo (a, " + word + ", b) { 'use strict'; }",
374                SyntaxError);
375   assertThrows("var foo = function (" + word + ") { 'use strict'; }",
376                SyntaxError);
377
378   // setter parameter when the body is strict
379   CheckStrictMode("var x = { set foo(" + word + ") {} };", SyntaxError);
380   assertThrows("var x = { set foo(" + word + ") { 'use strict'; } };",
381                SyntaxError);
382 }
383
384 for (var i = 0; i < future_strict_reserved_words.length; i++) {
385   testFutureStrictReservedWord(future_strict_reserved_words[i]);
386 }
387
388 function testAssignToUndefined(test, should_throw) {
389   try {
390     test();
391   } catch (e) {
392     assertTrue(should_throw, "strict mode");
393     assertInstanceof(e, ReferenceError, "strict mode");
394     return;
395   }
396   assertFalse(should_throw, "strict mode");
397 }
398
399 function repeat(n, f) {
400   for (var i = 0; i < n; i ++) { f(); }
401 }
402
403 function assignToUndefined() {
404   "use strict";
405   possibly_undefined_variable_for_strict_mode_test = "should throw?";
406 }
407
408 testAssignToUndefined(assignToUndefined, true);
409 testAssignToUndefined(assignToUndefined, true);
410 testAssignToUndefined(assignToUndefined, true);
411
412 possibly_undefined_variable_for_strict_mode_test = "value";
413
414 testAssignToUndefined(assignToUndefined, false);
415 testAssignToUndefined(assignToUndefined, false);
416 testAssignToUndefined(assignToUndefined, false);
417
418 delete possibly_undefined_variable_for_strict_mode_test;
419
420 testAssignToUndefined(assignToUndefined, true);
421 testAssignToUndefined(assignToUndefined, true);
422 testAssignToUndefined(assignToUndefined, true);
423
424 repeat(10, function() { testAssignToUndefined(assignToUndefined, true); });
425 possibly_undefined_variable_for_strict_mode_test = "value";
426 repeat(10, function() { testAssignToUndefined(assignToUndefined, false); });
427 delete possibly_undefined_variable_for_strict_mode_test;
428 repeat(10, function() { testAssignToUndefined(assignToUndefined, true); });
429 possibly_undefined_variable_for_strict_mode_test = undefined;
430 repeat(10, function() { testAssignToUndefined(assignToUndefined, false); });
431
432 function assignToUndefinedWithEval() {
433   "use strict";
434   possibly_undefined_variable_for_strict_mode_test_with_eval = "should throw?";
435   eval("");
436 }
437
438 testAssignToUndefined(assignToUndefinedWithEval, true);
439 testAssignToUndefined(assignToUndefinedWithEval, true);
440 testAssignToUndefined(assignToUndefinedWithEval, true);
441
442 possibly_undefined_variable_for_strict_mode_test_with_eval = "value";
443
444 testAssignToUndefined(assignToUndefinedWithEval, false);
445 testAssignToUndefined(assignToUndefinedWithEval, false);
446 testAssignToUndefined(assignToUndefinedWithEval, false);
447
448 delete possibly_undefined_variable_for_strict_mode_test_with_eval;
449
450 testAssignToUndefined(assignToUndefinedWithEval, true);
451 testAssignToUndefined(assignToUndefinedWithEval, true);
452 testAssignToUndefined(assignToUndefinedWithEval, true);
453
454 repeat(10, function() {
455              testAssignToUndefined(assignToUndefinedWithEval, true);
456            });
457 possibly_undefined_variable_for_strict_mode_test_with_eval = "value";
458 repeat(10, function() {
459              testAssignToUndefined(assignToUndefinedWithEval, false);
460            });
461 delete possibly_undefined_variable_for_strict_mode_test_with_eval;
462 repeat(10, function() {
463              testAssignToUndefined(assignToUndefinedWithEval, true);
464            });
465 possibly_undefined_variable_for_strict_mode_test_with_eval = undefined;
466 repeat(10, function() {
467              testAssignToUndefined(assignToUndefinedWithEval, false);
468            });
469
470
471
472 (function testDeleteNonConfigurable() {
473   function delete_property(o) {
474     "use strict";
475     delete o.property;
476   }
477   function delete_element(o, i) {
478     "use strict";
479     delete o[i];
480   }
481
482   var object = {};
483
484   Object.defineProperty(object, "property", { value: "property_value" });
485   Object.defineProperty(object, "1", { value: "one" });
486   Object.defineProperty(object, 7, { value: "seven" });
487   Object.defineProperty(object, 3.14, { value: "pi" });
488
489   assertThrows(function() { delete_property(object); }, TypeError);
490   assertEquals(object.property, "property_value");
491   assertThrows(function() { delete_element(object, "1"); }, TypeError);
492   assertThrows(function() { delete_element(object, 1); }, TypeError);
493   assertEquals(object[1], "one");
494   assertThrows(function() { delete_element(object, "7"); }, TypeError);
495   assertThrows(function() { delete_element(object, 7); }, TypeError);
496   assertEquals(object[7], "seven");
497   assertThrows(function() { delete_element(object, "3.14"); }, TypeError);
498   assertThrows(function() { delete_element(object, 3.14); }, TypeError);
499   assertEquals(object[3.14], "pi");
500 })();
501
502 // Not transforming this in Function.call and Function.apply.
503 (function testThisTransformCallApply() {
504   function non_strict() {
505     return this;
506   }
507   function strict() {
508     "use strict";
509     return this;
510   }
511
512   var global_object = (function() { return this; })();
513   var object = {};
514
515   // Non-strict call.
516   assertTrue(non_strict.call(null) === global_object);
517   assertTrue(non_strict.call(undefined) === global_object);
518   assertEquals(typeof non_strict.call(7), "object");
519   assertEquals(typeof non_strict.call("Hello"), "object");
520   assertTrue(non_strict.call(object) === object);
521
522   // Non-strict apply.
523   assertTrue(non_strict.apply(null) === global_object);
524   assertTrue(non_strict.apply(undefined) === global_object);
525   assertEquals(typeof non_strict.apply(7), "object");
526   assertEquals(typeof non_strict.apply("Hello"), "object");
527   assertTrue(non_strict.apply(object) === object);
528
529   // Strict call.
530   assertTrue(strict.call(null) === null);
531   assertTrue(strict.call(undefined) === undefined);
532   assertEquals(typeof strict.call(7), "number");
533   assertEquals(typeof strict.call("Hello"), "string");
534   assertTrue(strict.call(object) === object);
535
536   // Strict apply.
537   assertTrue(strict.apply(null) === null);
538   assertTrue(strict.apply(undefined) === undefined);
539   assertEquals(typeof strict.apply(7), "number");
540   assertEquals(typeof strict.apply("Hello"), "string");
541   assertTrue(strict.apply(object) === object);
542 })();
543
544 (function testThisTransform() {
545   try {
546     function strict() {
547       "use strict";
548       return typeof(this);
549     }
550     function nonstrict() {
551       return typeof(this);
552     }
553
554     // Concat to avoid symbol.
555     var strict_name = "str" + "ict";
556     var nonstrict_name = "non" + "str" + "ict";
557     var strict_number = 17;
558     var nonstrict_number = 19;
559     var strict_name_get = "str" + "ict" + "get";
560     var nonstrict_name_get = "non" + "str" + "ict" + "get"
561     var strict_number_get = 23;
562     var nonstrict_number_get = 29;
563
564     function install(t) {
565       t.prototype.strict = strict;
566       t.prototype.nonstrict = nonstrict;
567       t.prototype[strict_number] = strict;
568       t.prototype[nonstrict_number] = nonstrict;
569       Object.defineProperty(t.prototype, strict_name_get,
570                             { get: function() { return strict; },
571                               configurable: true });
572       Object.defineProperty(t.prototype, nonstrict_name_get,
573                             { get: function() { return nonstrict; },
574                               configurable: true });
575       Object.defineProperty(t.prototype, strict_number_get,
576                             { get: function() { return strict; },
577                               configurable: true });
578       Object.defineProperty(t.prototype, nonstrict_number_get,
579                             { get: function() { return nonstrict; },
580                               configurable: true });
581     }
582
583     function cleanup(t) {
584       delete t.prototype.strict;
585       delete t.prototype.nonstrict;
586       delete t.prototype[strict_number];
587       delete t.prototype[nonstrict_number];
588       delete t.prototype[strict_name_get];
589       delete t.prototype[nonstrict_name_get];
590       delete t.prototype[strict_number_get];
591       delete t.prototype[nonstrict_number_get];
592     }
593
594     // Set up fakes
595     install(String);
596     install(Number);
597     install(Boolean)
598
599     function callStrict(o) {
600       return o.strict();
601     }
602     function callNonStrict(o) {
603       return o.nonstrict();
604     }
605     function callKeyedStrict(o) {
606       return o[strict_name]();
607     }
608     function callKeyedNonStrict(o) {
609       return o[nonstrict_name]();
610     }
611     function callIndexedStrict(o) {
612       return o[strict_number]();
613     }
614     function callIndexedNonStrict(o) {
615       return o[nonstrict_number]();
616     }
617     function callStrictGet(o) {
618       return o.strictget();
619     }
620     function callNonStrictGet(o) {
621       return o.nonstrictget();
622     }
623     function callKeyedStrictGet(o) {
624       return o[strict_name_get]();
625     }
626     function callKeyedNonStrictGet(o) {
627       return o[nonstrict_name_get]();
628     }
629     function callIndexedStrictGet(o) {
630       return o[strict_number_get]();
631     }
632     function callIndexedNonStrictGet(o) {
633       return o[nonstrict_number_get]();
634     }
635
636     for (var i = 0; i < 10; i ++) {
637       assertEquals(("hello").strict(), "string");
638       assertEquals(("hello").nonstrict(), "object");
639       assertEquals(("hello")[strict_name](), "string");
640       assertEquals(("hello")[nonstrict_name](), "object");
641       assertEquals(("hello")[strict_number](), "string");
642       assertEquals(("hello")[nonstrict_number](), "object");
643
644       assertEquals((10 + i).strict(), "number");
645       assertEquals((10 + i).nonstrict(), "object");
646       assertEquals((10 + i)[strict_name](), "number");
647       assertEquals((10 + i)[nonstrict_name](), "object");
648       assertEquals((10 + i)[strict_number](), "number");
649       assertEquals((10 + i)[nonstrict_number](), "object");
650
651       assertEquals((true).strict(), "boolean");
652       assertEquals((true).nonstrict(), "object");
653       assertEquals((true)[strict_name](), "boolean");
654       assertEquals((true)[nonstrict_name](), "object");
655       assertEquals((true)[strict_number](), "boolean");
656       assertEquals((true)[nonstrict_number](), "object");
657
658       assertEquals((false).strict(), "boolean");
659       assertEquals((false).nonstrict(), "object");
660       assertEquals((false)[strict_name](), "boolean");
661       assertEquals((false)[nonstrict_name](), "object");
662       assertEquals((false)[strict_number](), "boolean");
663       assertEquals((false)[nonstrict_number](), "object");
664
665       assertEquals(callStrict("howdy"), "string");
666       assertEquals(callNonStrict("howdy"), "object");
667       assertEquals(callKeyedStrict("howdy"), "string");
668       assertEquals(callKeyedNonStrict("howdy"), "object");
669       assertEquals(callIndexedStrict("howdy"), "string");
670       assertEquals(callIndexedNonStrict("howdy"), "object");
671
672       assertEquals(callStrict(17 + i), "number");
673       assertEquals(callNonStrict(17 + i), "object");
674       assertEquals(callKeyedStrict(17 + i), "number");
675       assertEquals(callKeyedNonStrict(17 + i), "object");
676       assertEquals(callIndexedStrict(17 + i), "number");
677       assertEquals(callIndexedNonStrict(17 + i), "object");
678
679       assertEquals(callStrict(true), "boolean");
680       assertEquals(callNonStrict(true), "object");
681       assertEquals(callKeyedStrict(true), "boolean");
682       assertEquals(callKeyedNonStrict(true), "object");
683       assertEquals(callIndexedStrict(true), "boolean");
684       assertEquals(callIndexedNonStrict(true), "object");
685
686       assertEquals(callStrict(false), "boolean");
687       assertEquals(callNonStrict(false), "object");
688       assertEquals(callKeyedStrict(false), "boolean");
689       assertEquals(callKeyedNonStrict(false), "object");
690       assertEquals(callIndexedStrict(false), "boolean");
691       assertEquals(callIndexedNonStrict(false), "object");
692
693       // All of the above, with getters
694       assertEquals(("hello").strictget(), "string");
695       assertEquals(("hello").nonstrictget(), "object");
696       assertEquals(("hello")[strict_name_get](), "string");
697       assertEquals(("hello")[nonstrict_name_get](), "object");
698       assertEquals(("hello")[strict_number_get](), "string");
699       assertEquals(("hello")[nonstrict_number_get](), "object");
700
701       assertEquals((10 + i).strictget(), "number");
702       assertEquals((10 + i).nonstrictget(), "object");
703       assertEquals((10 + i)[strict_name_get](), "number");
704       assertEquals((10 + i)[nonstrict_name_get](), "object");
705       assertEquals((10 + i)[strict_number_get](), "number");
706       assertEquals((10 + i)[nonstrict_number_get](), "object");
707
708       assertEquals((true).strictget(), "boolean");
709       assertEquals((true).nonstrictget(), "object");
710       assertEquals((true)[strict_name_get](), "boolean");
711       assertEquals((true)[nonstrict_name_get](), "object");
712       assertEquals((true)[strict_number_get](), "boolean");
713       assertEquals((true)[nonstrict_number_get](), "object");
714
715       assertEquals((false).strictget(), "boolean");
716       assertEquals((false).nonstrictget(), "object");
717       assertEquals((false)[strict_name_get](), "boolean");
718       assertEquals((false)[nonstrict_name_get](), "object");
719       assertEquals((false)[strict_number_get](), "boolean");
720       assertEquals((false)[nonstrict_number_get](), "object");
721
722       assertEquals(callStrictGet("howdy"), "string");
723       assertEquals(callNonStrictGet("howdy"), "object");
724       assertEquals(callKeyedStrictGet("howdy"), "string");
725       assertEquals(callKeyedNonStrictGet("howdy"), "object");
726       assertEquals(callIndexedStrictGet("howdy"), "string");
727       assertEquals(callIndexedNonStrictGet("howdy"), "object");
728
729       assertEquals(callStrictGet(17 + i), "number");
730       assertEquals(callNonStrictGet(17 + i), "object");
731       assertEquals(callKeyedStrictGet(17 + i), "number");
732       assertEquals(callKeyedNonStrictGet(17 + i), "object");
733       assertEquals(callIndexedStrictGet(17 + i), "number");
734       assertEquals(callIndexedNonStrictGet(17 + i), "object");
735
736       assertEquals(callStrictGet(true), "boolean");
737       assertEquals(callNonStrictGet(true), "object");
738       assertEquals(callKeyedStrictGet(true), "boolean");
739       assertEquals(callKeyedNonStrictGet(true), "object");
740       assertEquals(callIndexedStrictGet(true), "boolean");
741       assertEquals(callIndexedNonStrictGet(true), "object");
742
743       assertEquals(callStrictGet(false), "boolean");
744       assertEquals(callNonStrictGet(false), "object");
745       assertEquals(callKeyedStrictGet(false), "boolean");
746       assertEquals(callKeyedNonStrictGet(false), "object");
747       assertEquals(callIndexedStrictGet(false), "boolean");
748       assertEquals(callIndexedNonStrictGet(false), "object");
749
750     }
751   } finally {
752     // Cleanup
753     cleanup(String);
754     cleanup(Number);
755     cleanup(Boolean);
756   }
757 })();
758
759
760 (function ObjectEnvironment() {
761   var o = {};
762   Object.defineProperty(o, "foo", { value: "FOO", writable: false });
763   assertThrows(
764     function () {
765       with (o) {
766         (function() {
767           "use strict";
768           foo = "Hello";
769         })();
770       }
771     },
772     TypeError);
773 })();
774
775
776 (function TestSetPropertyWithoutSetter() {
777   var o = { get foo() { return "Yey"; } };
778   assertThrows(
779     function broken() {
780       "use strict";
781       o.foo = (0xBADBAD00 >> 1);
782     },
783     TypeError);
784 })();
785
786
787 (function TestSetPropertyNonConfigurable() {
788   var frozen = Object.freeze({});
789   var sealed = Object.seal({});
790
791   function strict(o) {
792     "use strict";
793     o.property = "value";
794   }
795
796   assertThrows(function() { strict(frozen); }, TypeError);
797   assertThrows(function() { strict(sealed); }, TypeError);
798 })();
799
800
801 (function TestAssignmentToReadOnlyProperty() {
802   "use strict";
803
804   var o = {};
805   Object.defineProperty(o, "property", { value: 7 });
806
807   assertThrows(function() { o.property = "new value"; }, TypeError);
808   assertThrows(function() { o.property += 10; }, TypeError);
809   assertThrows(function() { o.property -= 10; }, TypeError);
810   assertThrows(function() { o.property *= 10; }, TypeError);
811   assertThrows(function() { o.property /= 10; }, TypeError);
812   assertThrows(function() { o.property++; }, TypeError);
813   assertThrows(function() { o.property--; }, TypeError);
814   assertThrows(function() { ++o.property; }, TypeError);
815   assertThrows(function() { --o.property; }, TypeError);
816
817   var name = "prop" + "erty"; // to avoid symbol path.
818   assertThrows(function() { o[name] = "new value"; }, TypeError);
819   assertThrows(function() { o[name] += 10; }, TypeError);
820   assertThrows(function() { o[name] -= 10; }, TypeError);
821   assertThrows(function() { o[name] *= 10; }, TypeError);
822   assertThrows(function() { o[name] /= 10; }, TypeError);
823   assertThrows(function() { o[name]++; }, TypeError);
824   assertThrows(function() { o[name]--; }, TypeError);
825   assertThrows(function() { ++o[name]; }, TypeError);
826   assertThrows(function() { --o[name]; }, TypeError);
827
828   assertEquals(o.property, 7);
829 })();
830
831
832 (function TestAssignmentToReadOnlyLoop() {
833   var name = "prop" + "erty"; // to avoid symbol path.
834   var o = {};
835   Object.defineProperty(o, "property", { value: 7 });
836
837   function strict(o, name) {
838     "use strict";
839     o[name] = "new value";
840   }
841
842   for (var i = 0; i < 10; i ++) {
843     var exception = false;
844     try {
845       strict(o, name);
846     } catch(e) {
847       exception = true;
848       assertInstanceof(e, TypeError);
849     }
850     assertTrue(exception);
851   }
852 })();
853
854
855 // Specialized KeyedStoreIC experiencing miss.
856 (function testKeyedStoreICStrict() {
857   var o = [9,8,7,6,5,4,3,2,1];
858
859   function test(o, i, v) {
860     "use strict";
861     o[i] = v;
862   }
863
864   for (var i = 0; i < 10; i ++) {
865     test(o, 5, 17);        // start specialized for smi indices
866     assertEquals(o[5], 17);
867     test(o, "a", 19);
868     assertEquals(o["a"], 19);
869     test(o, "5", 29);
870     assertEquals(o[5], 29);
871     test(o, 100000, 31);
872     assertEquals(o[100000], 31);
873   }
874 })();
875
876
877 (function TestSetElementWithoutSetter() {
878   "use strict";
879
880   var o = { };
881   Object.defineProperty(o, 0, { get : function() { } });
882
883   var zero_smi = 0;
884   var zero_number = new Number(0);
885   var zero_symbol = "0";
886   var zero_string = "-0-".substring(1,2);
887
888   assertThrows(function() { o[zero_smi] = "new value"; }, TypeError);
889   assertThrows(function() { o[zero_number] = "new value"; }, TypeError);
890   assertThrows(function() { o[zero_symbol] = "new value"; }, TypeError);
891   assertThrows(function() { o[zero_string] = "new value"; }, TypeError);
892 })();
893
894
895 (function TestSetElementNonConfigurable() {
896   "use strict";
897   var frozen = Object.freeze({});
898   var sealed = Object.seal({});
899
900   var zero_number = 0;
901   var zero_symbol = "0";
902   var zero_string = "-0-".substring(1,2);
903
904   assertThrows(function() { frozen[zero_number] = "value"; }, TypeError);
905   assertThrows(function() { sealed[zero_number] = "value"; }, TypeError);
906   assertThrows(function() { frozen[zero_symbol] = "value"; }, TypeError);
907   assertThrows(function() { sealed[zero_symbol] = "value"; }, TypeError);
908   assertThrows(function() { frozen[zero_string] = "value"; }, TypeError);
909   assertThrows(function() { sealed[zero_string] = "value"; }, TypeError);
910 })();
911
912
913 (function TestAssignmentToReadOnlyElement() {
914   "use strict";
915
916   var o = {};
917   Object.defineProperty(o, 7, { value: 17 });
918
919   var seven_smi = 7;
920   var seven_number = new Number(7);
921   var seven_symbol = "7";
922   var seven_string = "-7-".substring(1,2);
923
924   // Index with number.
925   assertThrows(function() { o[seven_smi] = "value"; }, TypeError);
926   assertThrows(function() { o[seven_smi] += 10; }, TypeError);
927   assertThrows(function() { o[seven_smi] -= 10; }, TypeError);
928   assertThrows(function() { o[seven_smi] *= 10; }, TypeError);
929   assertThrows(function() { o[seven_smi] /= 10; }, TypeError);
930   assertThrows(function() { o[seven_smi]++; }, TypeError);
931   assertThrows(function() { o[seven_smi]--; }, TypeError);
932   assertThrows(function() { ++o[seven_smi]; }, TypeError);
933   assertThrows(function() { --o[seven_smi]; }, TypeError);
934
935   assertThrows(function() { o[seven_number] = "value"; }, TypeError);
936   assertThrows(function() { o[seven_number] += 10; }, TypeError);
937   assertThrows(function() { o[seven_number] -= 10; }, TypeError);
938   assertThrows(function() { o[seven_number] *= 10; }, TypeError);
939   assertThrows(function() { o[seven_number] /= 10; }, TypeError);
940   assertThrows(function() { o[seven_number]++; }, TypeError);
941   assertThrows(function() { o[seven_number]--; }, TypeError);
942   assertThrows(function() { ++o[seven_number]; }, TypeError);
943   assertThrows(function() { --o[seven_number]; }, TypeError);
944
945   assertThrows(function() { o[seven_symbol] = "value"; }, TypeError);
946   assertThrows(function() { o[seven_symbol] += 10; }, TypeError);
947   assertThrows(function() { o[seven_symbol] -= 10; }, TypeError);
948   assertThrows(function() { o[seven_symbol] *= 10; }, TypeError);
949   assertThrows(function() { o[seven_symbol] /= 10; }, TypeError);
950   assertThrows(function() { o[seven_symbol]++; }, TypeError);
951   assertThrows(function() { o[seven_symbol]--; }, TypeError);
952   assertThrows(function() { ++o[seven_symbol]; }, TypeError);
953   assertThrows(function() { --o[seven_symbol]; }, TypeError);
954
955   assertThrows(function() { o[seven_string] = "value"; }, TypeError);
956   assertThrows(function() { o[seven_string] += 10; }, TypeError);
957   assertThrows(function() { o[seven_string] -= 10; }, TypeError);
958   assertThrows(function() { o[seven_string] *= 10; }, TypeError);
959   assertThrows(function() { o[seven_string] /= 10; }, TypeError);
960   assertThrows(function() { o[seven_string]++; }, TypeError);
961   assertThrows(function() { o[seven_string]--; }, TypeError);
962   assertThrows(function() { ++o[seven_string]; }, TypeError);
963   assertThrows(function() { --o[seven_string]; }, TypeError);
964
965   assertEquals(o[seven_number], 17);
966   assertEquals(o[seven_symbol], 17);
967   assertEquals(o[seven_string], 17);
968 })();
969
970
971 (function TestAssignmentToReadOnlyLoop() {
972   "use strict";
973
974   var o = {};
975   Object.defineProperty(o, 7, { value: 17 });
976
977   var seven_smi = 7;
978   var seven_number = new Number(7);
979   var seven_symbol = "7";
980   var seven_string = "-7-".substring(1,2);
981
982   for (var i = 0; i < 10; i ++) {
983     assertThrows(function() { o[seven_smi] = "value" }, TypeError);
984     assertThrows(function() { o[seven_number] = "value" }, TypeError);
985     assertThrows(function() { o[seven_symbol] = "value" }, TypeError);
986     assertThrows(function() { o[seven_string] = "value" }, TypeError);
987   }
988
989   assertEquals(o[7], 17);
990 })();
991
992
993 (function TestAssignmentToStringLength() {
994   "use strict";
995
996   var str_val = "string";
997   var str_obj = new String(str_val);
998   var str_cat = str_val + str_val + str_obj;
999
1000   assertThrows(function() { str_val.length = 1; }, TypeError);
1001   assertThrows(function() { str_obj.length = 1; }, TypeError);
1002   assertThrows(function() { str_cat.length = 1; }, TypeError);
1003 })();
1004
1005
1006 (function TestArgumentsAliasing() {
1007   function strict(a, b) {
1008     "use strict";
1009     a = "c";
1010     b = "d";
1011     return [a, b, arguments[0], arguments[1]];
1012   }
1013
1014   function nonstrict(a, b) {
1015     a = "c";
1016     b = "d";
1017     return [a, b, arguments[0], arguments[1]];
1018   }
1019
1020   assertEquals(["c", "d", "a", "b"], strict("a", "b"));
1021   assertEquals(["c", "d", "c", "d"], nonstrict("a", "b"));
1022 })();
1023
1024
1025 function CheckPillDescriptor(func, name) {
1026
1027   function CheckPill(pill) {
1028     assertEquals("function", typeof pill);
1029     assertInstanceof(pill, Function);
1030     pill.property = "value";
1031     assertEquals(pill.value, undefined);
1032     assertThrows(function() { 'use strict'; pill.property = "value"; },
1033                  TypeError);
1034     assertThrows(pill, TypeError);
1035     assertEquals(pill.prototype, (function(){}).prototype);
1036     var d = Object.getOwnPropertyDescriptor(pill, "prototype");
1037     assertFalse(d.writable);
1038     assertFalse(d.configurable);
1039     assertFalse(d.enumerable);
1040   }
1041
1042   var descriptor = Object.getOwnPropertyDescriptor(func, name);
1043   CheckPill(descriptor.get)
1044   CheckPill(descriptor.set);
1045   assertFalse(descriptor.enumerable);
1046   assertFalse(descriptor.configurable);
1047 }
1048
1049
1050 (function TestStrictFunctionPills() {
1051   function strict() {
1052     "use strict";
1053   }
1054   assertThrows(function() { strict.caller; }, TypeError);
1055   assertThrows(function() { strict.arguments; }, TypeError);
1056   assertThrows(function() { strict.caller = 42; }, TypeError);
1057   assertThrows(function() { strict.arguments = 42; }, TypeError);
1058
1059   var another = new Function("'use strict'");
1060   assertThrows(function() { another.caller; }, TypeError);
1061   assertThrows(function() { another.arguments; }, TypeError);
1062   assertThrows(function() { another.caller = 42; }, TypeError);
1063   assertThrows(function() { another.arguments = 42; }, TypeError);
1064
1065   var third = (function() { "use strict"; return function() {}; })();
1066   assertThrows(function() { third.caller; }, TypeError);
1067   assertThrows(function() { third.arguments; }, TypeError);
1068   assertThrows(function() { third.caller = 42; }, TypeError);
1069   assertThrows(function() { third.arguments = 42; }, TypeError);
1070
1071   CheckPillDescriptor(strict, "caller");
1072   CheckPillDescriptor(strict, "arguments");
1073   CheckPillDescriptor(another, "caller");
1074   CheckPillDescriptor(another, "arguments");
1075   CheckPillDescriptor(third, "caller");
1076   CheckPillDescriptor(third, "arguments");
1077 })();
1078
1079
1080 (function TestStrictFunctionWritablePrototype() {
1081   "use strict";
1082   function TheClass() {
1083   }
1084   assertThrows(function() { TheClass.caller; }, TypeError);
1085   assertThrows(function() { TheClass.arguments; }, TypeError);
1086
1087   // Strict functions must have writable prototype.
1088   TheClass.prototype = {
1089     func: function() { return "func_value"; },
1090     get accessor() { return "accessor_value"; },
1091     property: "property_value",
1092   };
1093
1094   var o = new TheClass();
1095   assertEquals(o.func(), "func_value");
1096   assertEquals(o.accessor, "accessor_value");
1097   assertEquals(o.property, "property_value");
1098 })();
1099
1100
1101 (function TestStrictArgumentPills() {
1102   function strict() {
1103     "use strict";
1104     return arguments;
1105   }
1106
1107   var args = strict();
1108   CheckPillDescriptor(args, "caller");
1109   CheckPillDescriptor(args, "callee");
1110
1111   args = strict(17, "value", strict);
1112   assertEquals(17, args[0])
1113   assertEquals("value", args[1])
1114   assertEquals(strict, args[2]);
1115   CheckPillDescriptor(args, "caller");
1116   CheckPillDescriptor(args, "callee");
1117
1118   function outer() {
1119     "use strict";
1120     function inner() {
1121       return arguments;
1122     }
1123     return inner;
1124   }
1125
1126   var args = outer()();
1127   CheckPillDescriptor(args, "caller");
1128   CheckPillDescriptor(args, "callee");
1129
1130   args = outer()(17, "value", strict);
1131   assertEquals(17, args[0])
1132   assertEquals("value", args[1])
1133   assertEquals(strict, args[2]);
1134   CheckPillDescriptor(args, "caller");
1135   CheckPillDescriptor(args, "callee");
1136 })();
1137
1138
1139 (function TestNonStrictFunctionCallerPillSimple() {
1140   function return_my_caller() {
1141     return return_my_caller.caller;
1142   }
1143
1144   function strict() {
1145     "use strict";
1146     return return_my_caller();
1147   }
1148   assertSame(null, strict());
1149
1150   function non_strict() {
1151     return return_my_caller();
1152   }
1153   assertSame(non_strict(), non_strict);
1154 })();
1155
1156
1157 (function TestNonStrictFunctionCallerPill() {
1158   function strict(n) {
1159     "use strict";
1160     return non_strict(n);
1161   }
1162
1163   function recurse(n, then) {
1164     if (n > 0) {
1165       return recurse(n - 1, then);
1166     } else {
1167       return then();
1168     }
1169   }
1170
1171   function non_strict(n) {
1172     return recurse(n, function() { return non_strict.caller; });
1173   }
1174
1175   function test(n) {
1176     return recurse(n, function() { return strict(n); });
1177   }
1178
1179   for (var i = 0; i < 10; i ++) {
1180     assertSame(null, test(i));
1181   }
1182 })();
1183
1184
1185 (function TestNonStrictFunctionCallerDescriptorPill() {
1186   function strict(n) {
1187     "use strict";
1188     return non_strict(n);
1189   }
1190
1191   function recurse(n, then) {
1192     if (n > 0) {
1193       return recurse(n - 1, then);
1194     } else {
1195       return then();
1196     }
1197   }
1198
1199   function non_strict(n) {
1200     return recurse(n, function() {
1201       return Object.getOwnPropertyDescriptor(non_strict, "caller").value;
1202     });
1203   }
1204
1205   function test(n) {
1206     return recurse(n, function() { return strict(n); });
1207   }
1208
1209   for (var i = 0; i < 10; i ++) {
1210     assertSame(null, test(i));
1211   }
1212 })();
1213
1214
1215 (function TestStrictModeEval() {
1216   "use strict";
1217   eval("var eval_local = 10;");
1218   assertThrows(function() { return eval_local; }, ReferenceError);
1219 })();