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);
        }
Exemple #2
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);
        }