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 // | |
5 // Flags: --harmony-function-name | |
6 | 4 |
7 (function testVariableDeclarationsFunction() { | 5 (function testVariableDeclarationsFunction() { |
8 'use strict'; | 6 'use strict'; |
9 var a = function(){}; | 7 var a = function(){}; |
10 assertEquals('a', a.name); | 8 assertEquals('a', a.name); |
11 let b = () => {}; | 9 let b = () => {}; |
12 assertEquals('b', b.name); | 10 assertEquals('b', b.name); |
13 const c = ((function(){})); | 11 const c = ((function(){})); |
14 assertEquals('c', c.name); | 12 assertEquals('c', c.name); |
15 | 13 |
(...skipping 347 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
363 var g = function*() {}; | 361 var g = function*() {}; |
364 var obj = { | 362 var obj = { |
365 ['h']: function() {}, | 363 ['h']: function() {}, |
366 i: () => {} | 364 i: () => {} |
367 }; | 365 }; |
368 assertEquals('function () {}', f.toString()); | 366 assertEquals('function () {}', f.toString()); |
369 assertEquals('function* () {}', g.toString()); | 367 assertEquals('function* () {}', g.toString()); |
370 assertEquals('function () {}', obj.h.toString()); | 368 assertEquals('function () {}', obj.h.toString()); |
371 assertEquals('() => {}', obj.i.toString()); | 369 assertEquals('() => {}', obj.i.toString()); |
372 })(); | 370 })(); |
OLD | NEW |