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); |