Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(316)

Side by Side Diff: test/mjsunit/harmony/function-name.js

Issue 1712833002: Don't reflect ES2015 Function name inference in Function.prototype.toString (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Move bits around to make STATIC_ASSERT happy Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/parsing/preparser.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 // Flags: --harmony-function-name 5 // Flags: --harmony-function-name
6 // Flags: --harmony-destructuring-bind --harmony-destructuring-assignment 6 // Flags: --harmony-destructuring-bind --harmony-destructuring-assignment
7 7
8 (function testVariableDeclarationsFunction() { 8 (function testVariableDeclarationsFunction() {
9 'use strict'; 9 'use strict';
10 var a = function(){}; 10 var a = function(){};
(...skipping 339 matching lines...) Expand 10 before | Expand all | Expand 10 after
350 assertEquals('[1]', class1[sym1].name); 350 assertEquals('[1]', class1[sym1].name);
351 })(); 351 })();
352 352
353 353
354 (function testComputedNamesOnlyAppliedSyntactically() { 354 (function testComputedNamesOnlyAppliedSyntactically() {
355 function factory() { return () => {}; } 355 function factory() { return () => {}; }
356 356
357 var obj = { ['foo']: factory() }; 357 var obj = { ['foo']: factory() };
358 assertEquals('', obj.foo.name); 358 assertEquals('', obj.foo.name);
359 })(); 359 })();
360
361
362 (function testNameNotReflectedInToString() {
363 var f = function() {};
364 var g = function*() {};
365 var obj = {
366 ['h']: function() {},
367 i: () => {}
368 };
369 assertEquals('function () {}', f.toString());
370 assertEquals('function* () {}', g.toString());
371 assertEquals('function () {}', obj.h.toString());
372 assertEquals('() => {}', obj.i.toString());
373 })();
OLDNEW
« no previous file with comments | « src/parsing/preparser.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698