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

Unified 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 side-by-side diff with in-line comments
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 »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/es6/function-name.js
diff --git a/test/mjsunit/es6/function-name.js b/test/mjsunit/es6/function-name.js
index 3b0a6fcacbad78efd3069bf41b966c74bc46ba79..12cb3e6db1640727b3aa689d017bd57abe5816ed 100644
--- a/test/mjsunit/es6/function-name.js
+++ b/test/mjsunit/es6/function-name.js
@@ -373,3 +373,16 @@
assertEquals('function () {}', obj.h.toString());
assertEquals('() => {}', obj.i.toString());
})();
+
+(function testClassNameOrder() {
+ assertEquals(['length', 'prototype'], Object.getOwnPropertyNames(class {}));
+
+ class A { }
+ assertEquals(['length', 'prototype', 'name'], Object.getOwnPropertyNames(A));
+
+ class B { static foo() { } }
+ assertEquals(['length', 'prototype', 'foo', 'name'], Object.getOwnPropertyNames(B));
+
+ class C { static name() { } static foo() { } }
+ assertEquals(['length', 'prototype', 'name', 'foo'], Object.getOwnPropertyNames(C));
+})();
« 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