Andrew Top | ef837fa | 2017-10-04 22:44:25 -0700 | [diff] [blame] | 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 | (function() { |
| 6 | function f() { |
| 7 | { |
| 8 | function f() { return 42 } |
| 9 | } |
| 10 | function g() { return f } |
| 11 | return g; |
| 12 | } |
| 13 | |
| 14 | var g = f(); |
| 15 | var inner_f = g(); |
| 16 | assertEquals(42, inner_f()); |
| 17 | })(); |
| 18 | |
| 19 | (function() { |
| 20 | var y = 100; |
| 21 | var z = (function y() { return y; }); |
| 22 | assertEquals(z, z()); |
| 23 | })(); |