Exemplo n.º 1
0
        private IdFunctionObject NewIdFunction(object tag, int id, string name, int arity, IScriptable scope)
        {
            IdFunctionObject f = new IdFunctionObject(this, tag, id, name, arity, scope);

            if (Sealed)
            {
                f.SealObject();
            }
            return(f);
        }
Exemplo n.º 2
0
        public void InitPrototypeConstructor(IdFunctionObject f)
        {
            int id = prototypeValues.constructorId;

            if (id == 0)
            {
                throw new ApplicationException();
            }
            if (f.MethodId != id)
            {
                throw new ArgumentException();
            }
            if (Sealed)
            {
                f.SealObject();
            }
            prototypeValues.InitValue(id, "constructor", f, DONTENUM);
        }
Exemplo n.º 3
0
        public IdFunctionObject ExportAsJSClass(int maxPrototypeId, IScriptable scope, bool zealed, int attributes)
        {
            // Set scope and prototype unless this is top level scope itself
            if (scope != this && scope != null)
            {
                ParentScope = scope;
                SetPrototype(GetObjectPrototype(scope));
            }

            ActivatePrototypeMap(maxPrototypeId);
            IdFunctionObject ctor = prototypeValues.createPrecachedConstructor();

            if (zealed)
            {
                SealObject();
            }
            FillConstructorProperties(ctor);
            if (zealed)
            {
                ctor.SealObject();
            }
            ctor.ExportAsScopeProperty(attributes);
            return(ctor);
        }
Exemplo n.º 4
0
 private IdFunctionObject NewIdFunction (object tag, int id, string name, int arity, IScriptable scope)
 {
     IdFunctionObject f = new IdFunctionObject (this, tag, id, name, arity, scope);
     if (Sealed) {
         f.SealObject ();
     }
     return f;
 }
Exemplo n.º 5
0
 public void InitPrototypeConstructor (IdFunctionObject f)
 {
     int id = prototypeValues.constructorId;
     if (id == 0)
         throw new ApplicationException ();
     if (f.MethodId != id)
         throw new ArgumentException ();
     if (Sealed) {
         f.SealObject ();
     }
     prototypeValues.InitValue (id, "constructor", f, DONTENUM);
 }