OLD | NEW |
---|---|
(Empty) | |
1 // Copyright 2016 the V8 project authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 // Flags: --allow-natives-syntax | |
6 | |
7 // Tests function bindings are correctly handled in ignition. | |
8 (function f() { | |
Michael Starzinger
2016/04/04 12:02:24
nit: Indentation within this function is off.
mythria
2016/04/11 10:10:05
Done.
| |
9 function assignSloppy() { | |
10 f = 0; | |
11 } | |
12 assertDoesNotThrow(assignSloppy); | |
13 function assignStrict() { | |
14 'use strict'; | |
15 f = 0; | |
16 } | |
17 assertThrows(assignStrict, TypeError); | |
18 })(); | |
19 | |
20 // Tests for compound assignments which are handled differently | |
21 // in crankshaft. | |
22 (function f() { | |
23 function assignSloppy() { | |
24 f += "x"; | |
25 } | |
26 assertDoesNotThrow(assignSloppy); | |
27 assertDoesNotThrow(assignSloppy); | |
28 %OptimizeFunctionOnNextCall(assignSloppy); | |
29 assertDoesNotThrow(assignSloppy); | |
30 function assignStrict() { | |
31 'use strict'; | |
32 f += "x"; | |
33 } | |
34 assertThrows(assignStrict, TypeError); | |
35 assertThrows(assignStrict, TypeError); | |
36 %OptimizeFunctionOnNextCall(assignStrict); | |
37 assertThrows(assignStrict, TypeError); | |
38 })(); | |
OLD | NEW |