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

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

Issue 2423053002: Install the 'name' property in classes at runtime (Closed)
Patch Set: rebased Created 4 years 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 | « test/mjsunit/es6/computed-property-names-classes.js ('k') | test/test262/test262.status » ('j') | 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 (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 355 matching lines...) Expand 10 before | Expand all | Expand 10 after
366 var g = function* () {}; 366 var g = function* () {};
367 var obj = { 367 var obj = {
368 ['h']: function () {}, 368 ['h']: function () {},
369 i: () => {} 369 i: () => {}
370 }; 370 };
371 assertEquals('function () {}', f.toString()); 371 assertEquals('function () {}', f.toString());
372 assertEquals('function* () {}', g.toString()); 372 assertEquals('function* () {}', g.toString());
373 assertEquals('function () {}', obj.h.toString()); 373 assertEquals('function () {}', obj.h.toString());
374 assertEquals('() => {}', obj.i.toString()); 374 assertEquals('() => {}', obj.i.toString());
375 })(); 375 })();
376
377 (function testClassNameOrder() {
378 assertEquals(['length', 'prototype'], Object.getOwnPropertyNames(class {}));
379
380 class A { }
381 assertEquals(['length', 'prototype', 'name'], Object.getOwnPropertyNames(A));
382
383 class B { static foo() { } }
384 assertEquals(['length', 'prototype', 'foo', 'name'], Object.getOwnPropertyName s(B));
385
386 class C { static name() { } static foo() { } }
387 assertEquals(['length', 'prototype', 'name', 'foo'], Object.getOwnPropertyName s(C));
388 })();
OLDNEW
« no previous file with comments | « test/mjsunit/es6/computed-property-names-classes.js ('k') | test/test262/test262.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698