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

Unified Diff: src/v8natives.js

Issue 624013005: Classes: Add support for toString (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Add type checks Created 6 years, 2 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/runtime-classes.cc ('k') | test/mjsunit/harmony/classes.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 782b953ea9763edf0dadbc32511d32a6deef0463..5adbca25b3b77b58379725f7b004cc161b7ed74a 100644
--- a/src/v8natives.js
+++ b/src/v8natives.js
@@ -1739,6 +1739,11 @@ function FunctionSourceString(func) {
throw new $TypeError('Function.prototype.toString is not generic');
}
+ var classSource = %ClassGetSourceCode(func);
+ if (IS_STRING(classSource)) {
+ return classSource;
+ }
+
var source = %FunctionGetSourceCode(func);
if (!IS_STRING(source) || %FunctionIsBuiltin(func)) {
var name = %FunctionGetName(func);
« no previous file with comments | « src/runtime/runtime-classes.cc ('k') | test/mjsunit/harmony/classes.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698