| 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 (function testVariableDeclarationsFunction() { | 5 (function testVariableDeclarationsFunction() { |
| 6 'use strict'; | 6 'use strict'; |
| 7 var a = function(){}; | 7 var a = function(){}; |
| 8 assertEquals('a', a.name); | 8 assertEquals('a', a.name); |
| 9 let b = () => {}; | 9 let b = () => {}; |
| 10 assertEquals('b', b.name); | 10 assertEquals('b', b.name); |
| (...skipping 339 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 350 | 350 |
| 351 (function testComputedNamesOnlyAppliedSyntactically() { | 351 (function testComputedNamesOnlyAppliedSyntactically() { |
| 352 function factory() { return () => {}; } | 352 function factory() { return () => {}; } |
| 353 | 353 |
| 354 var obj = { ['foo']: factory() }; | 354 var obj = { ['foo']: factory() }; |
| 355 assertEquals('', obj.foo.name); | 355 assertEquals('', obj.foo.name); |
| 356 })(); | 356 })(); |
| 357 | 357 |
| 358 | 358 |
| 359 (function testNameNotReflectedInToString() { | 359 (function testNameNotReflectedInToString() { |
| 360 var f = function() {}; | 360 var f = function () {}; |
| 361 var g = function*() {}; | 361 var g = function* () {}; |
| 362 var obj = { | 362 var obj = { |
| 363 ['h']: function() {}, | 363 ['h']: function () {}, |
| 364 i: () => {} | 364 i: () => {} |
| 365 }; | 365 }; |
| 366 assertEquals('function () {}', f.toString()); | 366 assertEquals('function () {}', f.toString()); |
| 367 assertEquals('function* () {}', g.toString()); | 367 assertEquals('function* () {}', g.toString()); |
| 368 assertEquals('function () {}', obj.h.toString()); | 368 assertEquals('function () {}', obj.h.toString()); |
| 369 assertEquals('() => {}', obj.i.toString()); | 369 assertEquals('() => {}', obj.i.toString()); |
| 370 })(); | 370 })(); |
| OLD | NEW |