Index: src/generator.js |
diff --git a/src/generator.js b/src/generator.js |
index 9ab7dcb9aab9b78baea82ca749ce129a5350be75..fa6e9764ad1865b6c7e23dc7054ec4cc11ccf431 100644 |
--- a/src/generator.js |
+++ b/src/generator.js |
@@ -74,7 +74,13 @@ function GeneratorFunctionPrototypeConstructor(x) { |
} |
function GeneratorFunctionConstructor(arg1) { // length == 1 |
- return NewFunctionFromString(arguments, 'function*'); |
+ var source = NewFunctionString(arguments, 'function*'); |
+ var global_proxy = %GlobalProxy(global); |
+ // Compile the string in the constructor and not a helper so that errors |
+ // appear to come from here. |
+ var f = %_CallFunction(global_proxy, %CompileString(source, true)); |
+ %FunctionMarkNameShouldPrintAsAnonymous(f); |
+ return f; |
} |