예제 #1
0
        internal static object NewWithSpecial(Context cx, IScriptable scope, object [] args)
        {
            ScriptRuntime.checkDeprecated(cx, "With");
            scope = ScriptableObject.GetTopLevelScope(scope);
            BuiltinWith thisObj = new BuiltinWith();

            thisObj.SetPrototype(args.Length == 0 ? ScriptableObject.getClassPrototype(scope, "Object") : ScriptConvert.ToObject(cx, scope, args [0]));
            thisObj.ParentScope = scope;
            return(thisObj);
        }
예제 #2
0
        internal static void Init (IScriptable scope, bool zealed)
        {
            BuiltinWith obj = new BuiltinWith ();

            obj.ParentScope = scope;
            obj.SetPrototype (ScriptableObject.GetObjectPrototype (scope));

            IdFunctionObject ctor = new IdFunctionObject (obj, FTAG, Id_constructor, "With", 0, scope);
            ctor.MarkAsConstructor (obj);
            if (zealed) {
                ctor.SealObject ();
            }
            ctor.ExportAsScopeProperty ();
        }
예제 #3
0
        internal static void Init(IScriptable scope, bool zealed)
        {
            BuiltinWith obj = new BuiltinWith();

            obj.ParentScope = scope;
            obj.SetPrototype(ScriptableObject.GetObjectPrototype(scope));

            IdFunctionObject ctor = new IdFunctionObject(obj, FTAG, Id_constructor, "With", 0, scope);

            ctor.MarkAsConstructor(obj);
            if (zealed)
            {
                ctor.SealObject();
            }
            ctor.ExportAsScopeProperty();
        }
예제 #4
0
 internal static object NewWithSpecial(Context cx, IScriptable scope, object [] args)
 {
     ScriptRuntime.checkDeprecated (cx, "With");
     scope = ScriptableObject.GetTopLevelScope (scope);
     BuiltinWith thisObj = new BuiltinWith ();
     thisObj.SetPrototype (args.Length == 0 ? ScriptableObject.getClassPrototype (scope, "Object") : ScriptConvert.ToObject (cx, scope, args [0]));
     thisObj.ParentScope = scope;
     return thisObj;
 }