Index: src/generator.js |
diff --git a/src/generator.js b/src/generator.js |
index 76dd8e47f1db0b670bb296a41c2f2892a79b58b4..d041c5b223385c538954c757b2cffcc21b0628a9 100644 |
--- a/src/generator.js |
+++ b/src/generator.js |
@@ -8,8 +8,17 @@ |
%CheckIsBootstrapping(); |
+// ------------------------------------------------------------------- |
+// Imports |
+ |
var GlobalFunction = global.Function; |
+var NewFunctionString; |
+ |
+utils.Import(function(from) { |
+ NewFunctionString = from.NewFunctionString; |
+}); |
+ |
// ---------------------------------------------------------------------------- |
// Generator functions and objects are specified by ES6, sections 15.19.3 and |
@@ -67,7 +76,7 @@ function GeneratorObjectThrow(exn) { |
function GeneratorFunctionConstructor(arg1) { // length == 1 |
- var source = $newFunctionString(arguments, 'function*'); |
+ var source = NewFunctionString(arguments, 'function*'); |
var global_proxy = %GlobalProxy(GeneratorFunctionConstructor); |
// Compile the string in the constructor and not a helper so that errors |
// appear to come from here. |
@@ -85,10 +94,10 @@ function GeneratorFunctionConstructor(arg1) { // length == 1 |
// Set up non-enumerable functions on the generator prototype object. |
var GeneratorObjectPrototype = GeneratorFunctionPrototype.prototype; |
-$installFunctions(GeneratorObjectPrototype, |
- DONT_ENUM, |
- ["next", GeneratorObjectNext, |
- "throw", GeneratorObjectThrow]); |
+utils.InstallFunctions(GeneratorObjectPrototype, |
+ DONT_ENUM, |
+ ["next", GeneratorObjectNext, |
+ "throw", GeneratorObjectThrow]); |
%AddNamedProperty(GeneratorObjectPrototype, "constructor", |
GeneratorFunctionPrototype, DONT_ENUM | READ_ONLY); |