Index: src/v8natives.js |
diff --git a/src/v8natives.js b/src/v8natives.js |
index 602d75b5b9ffadb5b395f06e3339d5bb7d76b456..68ca9001864afa5888bd1a6316f657e39f8bf414 100644 |
--- a/src/v8natives.js |
+++ b/src/v8natives.js |
@@ -1840,7 +1840,9 @@ function FunctionConstructor(arg1) { // length == 1 |
var global_receiver = %GlobalReceiver(global); |
// Compile the string in the constructor and not a helper so that errors |
// appear to come from here. |
- var f = %_CallFunction(global_receiver, %CompileString(source, true)); |
+ var f = %CompileString(source, true); |
+ if (!IS_FUNCTION(f)) return f; |
+ f = %_CallFunction(global_receiver, f); |
%FunctionMarkNameShouldPrintAsAnonymous(f); |
return f; |
} |