public static void PushStackFrameForMethod(object thisob, JSLocalField[] fields, VsaEngine engine)
        {
            Globals           globals = engine.Globals;
            IActivationObject obj2    = (IActivationObject)globals.ScopeStack.Peek();
            string            name    = thisob.GetType().Namespace;
            WithObject        parent  = null;

            if ((name != null) && (name.Length > 0))
            {
                parent = new WithObject(obj2.GetGlobalScope(), new WrappedNamespace(name, engine))
                {
                    isKnownAtCompileTime = true
                };
                parent = new WithObject(parent, thisob);
            }
            else
            {
                parent = new WithObject(obj2.GetGlobalScope(), thisob);
            }
            parent.isKnownAtCompileTime = true;
            Microsoft.JScript.StackFrame item = new Microsoft.JScript.StackFrame(parent, fields, new object[fields.Length], thisob)
            {
                closureInstance = thisob
            };
            globals.ScopeStack.GuardedPush(item);
        }
        public object GetDefaultThisObject()
        {
            ScriptObject      parent = base.GetParent();
            IActivationObject obj3   = parent as IActivationObject;

            if (obj3 != null)
            {
                return(obj3.GetDefaultThisObject());
            }
            return(parent);
        }
Example #3
0
        public Object GetDefaultThisObject()
        {
            ScriptObject      parent = this.GetParent();
            IActivationObject iob    = parent as IActivationObject;

            if (iob != null)
            {
                return(iob.GetDefaultThisObject());
            }
            return(parent);
        }
Example #4
0
        public static void PushStackFrameForMethod(Object thisob, JSLocalField[] fields, VsaEngine engine)
        {
            Globals           globals          = engine.Globals;
            IActivationObject top              = (IActivationObject)globals.ScopeStack.Peek();
            String            currentNamespace = thisob.GetType().Namespace;
            WithObject        wob              = null;

            if (currentNamespace != null && currentNamespace.Length > 0)
            {
                wob = new WithObject(top.GetGlobalScope(), new WrappedNamespace(currentNamespace, engine));
                wob.isKnownAtCompileTime = true; //For use by an eval inside this method
                wob = new WithObject(wob, thisob);
            }
            else
            {
                wob = new WithObject(top.GetGlobalScope(), thisob);
            }
            wob.isKnownAtCompileTime = true;
            StackFrame sf = new StackFrame(wob, fields, new Object[fields.Length], thisob);

            sf.closureInstance = thisob;
            globals.ScopeStack.GuardedPush(sf);
        }