OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 // Flags: --harmony-arrow-functions --allow-natives-syntax |
| 6 |
| 7 (function(x) { |
| 8 (function(x) { |
| 9 var boom = (() => eval(x)); |
| 10 assertEquals(23, boom()); |
| 11 assertEquals(23, boom()); |
| 12 %OptimizeFunctionOnNextCall(boom); |
| 13 assertEquals(23, boom()); |
| 14 assertEquals("23", x); |
| 15 })("23"); |
| 16 assertEquals("42", x); |
| 17 })("42"); |
| 18 |
| 19 (function(x) { |
| 20 (function(x) { |
| 21 var boom = (() => (eval("var x = 66"), x)); |
| 22 assertEquals(66, boom()); |
| 23 assertEquals(66, boom()); |
| 24 %OptimizeFunctionOnNextCall(boom); |
| 25 assertEquals(66, boom()); |
| 26 assertEquals("23", x); |
| 27 })("23"); |
| 28 assertEquals("42", x); |
| 29 })("42"); |
OLD | NEW |