OLD | NEW |
---|---|
(Empty) | |
1 // Copyright 2017 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 // MODULE | |
6 // Flags: --allow-natives-syntax --turbo | |
7 | |
8 export let x = 0; | |
9 | |
10 function foo() { return x++ }; | |
11 | |
12 function gaga(f) { return f() }; | |
13 | |
14 assertEquals(0, gaga(foo)); | |
15 assertEquals(1, gaga(foo)); | |
16 %OptimizeFunctionOnNextCall(gaga); | |
17 assertEquals(2, gaga(foo)); | |
OLD | NEW |