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

Unified Diff: src/v8natives.js

Issue 577973002: ES6: Implement generator method shorthand (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Cleanup based on code review Created 6 years, 3 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
Index: src/v8natives.js
diff --git a/src/v8natives.js b/src/v8natives.js
index 405e7d6790932b66b473ff83478f504363ca7894..8614dc8aedbe5e368d5a285e8b1f7404ede2dadc 100644
--- a/src/v8natives.js
+++ b/src/v8natives.js
@@ -1758,11 +1758,10 @@ function FunctionSourceString(func) {
? 'anonymous'
: %FunctionGetName(func);
- // TODO(arv): Handle concise generator methods.
-
+ var isGenerator = %FunctionIsGenerator(func);
var head = %FunctionIsConciseMethod(func)
- ? ''
- : %FunctionIsGenerator(func) ? 'function* ' : 'function ';
+ ? (isGenerator ? '*' : '')
+ : (isGenerator ? 'function* ' : 'function ');
return head + name + source;
}
« no previous file with comments | « src/preparser.h ('k') | test/cctest/test-parsing.cc » ('j') | test/cctest/test-parsing.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698