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

Unified Diff: test/mjsunit/harmony/function-name.js

Issue 1582783004: [es6] add SetFunctionName() behaviour to AssignmentExpression (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/parsing/preparser.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/harmony/function-name.js
diff --git a/test/mjsunit/harmony/function-name.js b/test/mjsunit/harmony/function-name.js
index af49bc0b2c3b4843b3bda782be397638d005afc5..9f8f3fa0d8e7dcdbd2138adf7ff295a3e7e2432f 100644
--- a/test/mjsunit/harmony/function-name.js
+++ b/test/mjsunit/harmony/function-name.js
@@ -120,3 +120,28 @@
// Should be '[2]'
assertEquals('', C[sym2].name);
})();
+
+
+(function testAssignment() {
+ var basicFn, arrowFn, generatorFn, classLit;
+
+ basicFn = function() { return true; };
adamk 2016/01/13 22:45:09 Please also add a case where the function has a na
caitp (gmail) 2016/01/13 22:53:46 Done.
+ assertEquals('basicFn', basicFn.name);
+ var basicFn2 = basicFn;
+ assertEquals('basicFn', basicFn2.name);
+
+ arrowFn = x => x;
+ assertEquals('arrowFn', arrowFn.name);
+ var arrowFn2 = arrowFn;
+ assertEquals('arrowFn', arrowFn2.name);
+
+ generatorFn = function*() { yield true; };
+ assertEquals('generatorFn', generatorFn.name);
+ var generatorFn2 = generatorFn;
+ assertEquals('generatorFn', generatorFn2.name);
+
+ classLit = class { constructor() {} };
adamk 2016/01/13 22:45:09 Can you also add a case where the class is named,
caitp (gmail) 2016/01/13 22:53:46 Done.
+ assertEquals('classLit', classLit.name);
+ var classLit2 = classLit;
+ assertEquals('classLit', classLit2.name);
+})();
« no previous file with comments | « src/parsing/preparser.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698