OLD | NEW |
1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 // Flags: --harmony-default-parameters --harmony-destructuring | 5 // Flags: --harmony-default-parameters --harmony-destructuring-bind |
6 | 6 |
7 | 7 |
8 (function TestSloppyEvalScoping() { | 8 (function TestSloppyEvalScoping() { |
9 var x = 1; | 9 var x = 1; |
10 | 10 |
11 function f41({[eval("var x = 2; 'a'")]: w}, z = x) { return z; } | 11 function f41({[eval("var x = 2; 'a'")]: w}, z = x) { return z; } |
12 assertEquals(1, f41({})); | 12 assertEquals(1, f41({})); |
13 assertEquals(1, f41({a: 0})); | 13 assertEquals(1, f41({a: 0})); |
14 function f42({[eval("var x = 2; 'a'")]: w}, z = eval("x")) { return z; } | 14 function f42({[eval("var x = 2; 'a'")]: w}, z = eval("x")) { return z; } |
15 assertEquals(1, f42({})); | 15 assertEquals(1, f42({})); |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
103 function f72({[eval("var x = 2; 'a'")]: w, b = eval("x")}) { return b; } | 103 function f72({[eval("var x = 2; 'a'")]: w, b = eval("x")}) { return b; } |
104 assertEquals(1, f72({})); | 104 assertEquals(1, f72({})); |
105 assertEquals(1, f72({a: 0})); | 105 assertEquals(1, f72({a: 0})); |
106 function f73({a: w = eval("var x = 2"), b = x}) { return b; } | 106 function f73({a: w = eval("var x = 2"), b = x}) { return b; } |
107 assertEquals(1, f73({})); | 107 assertEquals(1, f73({})); |
108 assertEquals(1, f73({a: 0})); | 108 assertEquals(1, f73({a: 0})); |
109 function f74({a: w = eval("var x = 2"), b = eval("x")}) { return b; } | 109 function f74({a: w = eval("var x = 2"), b = eval("x")}) { return b; } |
110 assertEquals(1, f74({})); | 110 assertEquals(1, f74({})); |
111 assertEquals(1, f74({a: 0})); | 111 assertEquals(1, f74({a: 0})); |
112 })(); | 112 })(); |
OLD | NEW |