public HGeneratorIterator(IEnvironment environment, Generator generator, ReadOnlyList<string> variableDeclarations, ILexicalEnvironment scope)
     : base(environment)
 {
     Generator = generator;
     VariableDeclarations = variableDeclarations;
     Scope = scope;
 }
Beispiel #2
0
 public HGeneratorIterable(IEnvironment environment, ReadOnlyList <GeneratorStep> steps, ReadOnlyList <string> variableDeclarations, ILexicalEnvironment scope)
     : base(environment)
 {
     Steps = steps;
     VariableDeclarations = variableDeclarations;
     Scope = scope;
 }
 public HGeneratorIterable(IEnvironment environment, ReadOnlyList<GeneratorStep> steps, ReadOnlyList<string> variableDeclarations, ILexicalEnvironment scope)
     : base(environment)
 {
     Steps = steps;
     VariableDeclarations = variableDeclarations;
     Scope = scope;
 }
 public HGeneratorIterator(IEnvironment environment, Generator generator, ReadOnlyList <string> variableDeclarations, ILexicalEnvironment scope)
     : base(environment)
 {
     Generator            = generator;
     VariableDeclarations = variableDeclarations;
     Scope = scope;
 }
 public SLexicalEnvironment(IEnvironment environment, IEnvironmentRecord record, ILexicalEnvironment parent)
 {
     _environment = environment;
     Record       = record;
     Parent       = parent;
 }
Beispiel #6
0
 public IObject CreateIterableFromGenerator(ReadOnlyList<GeneratorStep> steps, ReadOnlyList<string> variableDeclarations, ILexicalEnvironment scope)
 {
     return new HGeneratorIterable(this, steps, variableDeclarations, scope);
 }
Beispiel #7
0
        public IObject CreateFunction(ExecutableCode executableCode, ReadOnlyList<string> formalParameters, ILexicalEnvironment scope)
        {
            // 13.2 Creating Function Objects

            var f = new NFunction(this);
            {
                f.Class = "Function";
                f.Extensible = true;
                f.Prototype = FunctionPrototype;
                f.ExecutableCode = executableCode;
                f.FormalParameters = formalParameters;
                f.Scope = scope;

                f.DefineOwnProperty("length", CreateDataDescriptor(CreateNumber(f.FormalParameters.Count), false, false ,false), false);
                f.DefineOwnProperty("constructor", CreateDataDescriptor(f, true, false, true), false);
                f.DefineOwnProperty("prototype", CreateDataDescriptor(ObjectConstructor.Op_Construct(EmptyArgs), true, false, false), false);

                if (executableCode.Strict)
                {
                    var desc = CreateAccessorDescriptor(ThrowTypeErrorFunction, ThrowTypeErrorFunction, false, false);
                    f.DefineOwnProperty("caller", desc, false);
                    f.DefineOwnProperty("arguments", desc, false);
                }
            }
            return f;
        }
Beispiel #8
0
 public IObject CreateIterableFromGenerator(ReadOnlyList <GeneratorStep> steps, ReadOnlyList <string> variableDeclarations, ILexicalEnvironment scope)
 {
     return(new HGeneratorIterable(this, steps, variableDeclarations, scope));
 }
Beispiel #9
0
        public IObject CreateFunction(ExecutableCode executableCode, ReadOnlyList <string> formalParameters, ILexicalEnvironment scope)
        {
            // 13.2 Creating Function Objects

            var f = new NFunction(this);

            {
                f.Class            = "Function";
                f.Extensible       = true;
                f.Prototype        = FunctionPrototype;
                f.ExecutableCode   = executableCode;
                f.FormalParameters = formalParameters;
                f.Scope            = scope;

                f.DefineOwnProperty("length", CreateDataDescriptor(CreateNumber(f.FormalParameters.Count), false, false, false), false);
                f.DefineOwnProperty("constructor", CreateDataDescriptor(f, true, false, true), false);
                f.DefineOwnProperty("prototype", CreateDataDescriptor(ObjectConstructor.Op_Construct(EmptyArgs), true, false, false), false);

                if (executableCode.Strict)
                {
                    var desc = CreateAccessorDescriptor(ThrowTypeErrorFunction, ThrowTypeErrorFunction, false, false);
                    f.DefineOwnProperty("caller", desc, false);
                    f.DefineOwnProperty("arguments", desc, false);
                }
            }
            return(f);
        }
 public SLexicalEnvironment(IEnvironment environment, IEnvironmentRecord record, ILexicalEnvironment parent)
 {
     _environment = environment;
     Record = record;
     Parent = parent;
 }