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

Unified Diff: src/v8natives.js

Issue 14912002: toString() on generator functions prints with function* (Closed) Base URL: git://github.com/v8/v8.git@master
Patch Set: Created 7 years, 8 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/runtime.cc ('k') | test/mjsunit/harmony/generators-runtime.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/v8natives.js
diff --git a/src/v8natives.js b/src/v8natives.js
index 425863e5010fd63f3f9240b051e5007cca2450e7..a13bb86dc0923da55353c9e26445b03ebe07a2d8 100644
--- a/src/v8natives.js
+++ b/src/v8natives.js
@@ -1684,7 +1684,8 @@ function FunctionSourceString(func) {
var name = %FunctionNameShouldPrintAsAnonymous(func)
? 'anonymous'
: %FunctionGetName(func);
- return 'function ' + name + source;
+ var head = %FunctionIsGenerator(func) ? 'function* ' : 'function ';
+ return head + name + source;
}
« no previous file with comments | « src/runtime.cc ('k') | test/mjsunit/harmony/generators-runtime.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698