Loading js/src/frontend/BytecodeEmitter.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -1605,7 +1605,7 @@ BytecodeEmitter::needsImplicitThis() } } for (const FunctionBox *funbox = this->sc->funbox; funbox; funbox = funbox->parent) { if (funbox->tcflags & TCF_IN_WITH) if (funbox->inWith) return true; } for (StmtInfo *stmt = sc->topStmt; stmt; stmt = stmt->down) { Loading js/src/frontend/ParseNode.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -112,7 +112,7 @@ bool FunctionBox::inAnyDynamicScope() const { for (const FunctionBox *funbox = this; funbox; funbox = funbox->parent) { if (funbox->tcflags & (TCF_IN_WITH | TCF_FUN_EXTENSIBLE_SCOPE)) if (funbox->inWith || (funbox->tcflags & TCF_FUN_EXTENSIBLE_SCOPE)) return true; } return false; Loading js/src/frontend/ParseNode.h +2 −0 Original line number Diff line number Diff line Loading @@ -1543,6 +1543,8 @@ struct FunctionBox : public ObjectBox inLoop:1, /* in a loop in parent function */ level:JSFB_LEVEL_BITS; uint32_t tcflags; bool inWith:1; /* some enclosing scope is a with-statement or E4X filter-expression */ JSFunction *function() const { return (JSFunction *) object; } Loading js/src/frontend/Parser.cpp +2 −3 Original line number Diff line number Diff line Loading @@ -237,13 +237,12 @@ Parser::newFunctionBox(JSObject *obj, ParseNode *fn, TreeContext *tc) } funbox->level = tc->sc->staticLevel; funbox->tcflags = tc->sc->flags & TCF_STRICT_MODE_CODE; if (tc->innermostWith) funbox->tcflags |= TCF_IN_WITH; funbox->inWith = !!tc->innermostWith; if (!tc->sc->inFunction) { JSObject *scope = tc->sc->scopeChain(); while (scope) { if (scope->isWith()) funbox->tcflags |= TCF_IN_WITH; funbox->inWith = true; scope = scope->enclosingScope(); } } Loading js/src/frontend/TreeContext.h +3 −6 Original line number Diff line number Diff line Loading @@ -103,9 +103,6 @@ JS_ENUM_HEADER(TreeContextFlags, uint32_t) // The script contains singleton initialiser JSOP_OBJECT. TCF_HAS_SINGLETONS = 0x40, // Some enclosing scope is a with-statement or E4X filter-expression. TCF_IN_WITH = 0x80, // This function does something that can extend the set of bindings in its // call objects --- it does a direct eval in non-strict code, or includes a // function statement (as opposed to a function definition). Loading @@ -113,7 +110,7 @@ JS_ENUM_HEADER(TreeContextFlags, uint32_t) // This flag is *not* inherited by enclosed or enclosing functions; it // applies only to the function in whose flags it appears. // TCF_FUN_EXTENSIBLE_SCOPE = 0x100, TCF_FUN_EXTENSIBLE_SCOPE = 0x80, // Technically, every function has a binding named 'arguments'. Internally, // this binding is only added when 'arguments' is mentioned by the function Loading @@ -136,7 +133,7 @@ JS_ENUM_HEADER(TreeContextFlags, uint32_t) // have no special semantics: the initial value is unconditionally the // actual argument (or undefined if nactual < nformal). // TCF_ARGUMENTS_HAS_LOCAL_BINDING = 0x200, TCF_ARGUMENTS_HAS_LOCAL_BINDING = 0x100, // In many cases where 'arguments' has a local binding (as described above) // we do not need to actually create an arguments object in the function Loading @@ -147,7 +144,7 @@ JS_ENUM_HEADER(TreeContextFlags, uint32_t) // be unsound in several cases. The frontend filters out such cases by // setting this flag which eagerly sets script->needsArgsObj to true. // TCF_DEFINITELY_NEEDS_ARGS_OBJ = 0x400 TCF_DEFINITELY_NEEDS_ARGS_OBJ = 0x200 } JS_ENUM_FOOTER(TreeContextFlags); Loading Loading
js/src/frontend/BytecodeEmitter.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -1605,7 +1605,7 @@ BytecodeEmitter::needsImplicitThis() } } for (const FunctionBox *funbox = this->sc->funbox; funbox; funbox = funbox->parent) { if (funbox->tcflags & TCF_IN_WITH) if (funbox->inWith) return true; } for (StmtInfo *stmt = sc->topStmt; stmt; stmt = stmt->down) { Loading
js/src/frontend/ParseNode.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -112,7 +112,7 @@ bool FunctionBox::inAnyDynamicScope() const { for (const FunctionBox *funbox = this; funbox; funbox = funbox->parent) { if (funbox->tcflags & (TCF_IN_WITH | TCF_FUN_EXTENSIBLE_SCOPE)) if (funbox->inWith || (funbox->tcflags & TCF_FUN_EXTENSIBLE_SCOPE)) return true; } return false; Loading
js/src/frontend/ParseNode.h +2 −0 Original line number Diff line number Diff line Loading @@ -1543,6 +1543,8 @@ struct FunctionBox : public ObjectBox inLoop:1, /* in a loop in parent function */ level:JSFB_LEVEL_BITS; uint32_t tcflags; bool inWith:1; /* some enclosing scope is a with-statement or E4X filter-expression */ JSFunction *function() const { return (JSFunction *) object; } Loading
js/src/frontend/Parser.cpp +2 −3 Original line number Diff line number Diff line Loading @@ -237,13 +237,12 @@ Parser::newFunctionBox(JSObject *obj, ParseNode *fn, TreeContext *tc) } funbox->level = tc->sc->staticLevel; funbox->tcflags = tc->sc->flags & TCF_STRICT_MODE_CODE; if (tc->innermostWith) funbox->tcflags |= TCF_IN_WITH; funbox->inWith = !!tc->innermostWith; if (!tc->sc->inFunction) { JSObject *scope = tc->sc->scopeChain(); while (scope) { if (scope->isWith()) funbox->tcflags |= TCF_IN_WITH; funbox->inWith = true; scope = scope->enclosingScope(); } } Loading
js/src/frontend/TreeContext.h +3 −6 Original line number Diff line number Diff line Loading @@ -103,9 +103,6 @@ JS_ENUM_HEADER(TreeContextFlags, uint32_t) // The script contains singleton initialiser JSOP_OBJECT. TCF_HAS_SINGLETONS = 0x40, // Some enclosing scope is a with-statement or E4X filter-expression. TCF_IN_WITH = 0x80, // This function does something that can extend the set of bindings in its // call objects --- it does a direct eval in non-strict code, or includes a // function statement (as opposed to a function definition). Loading @@ -113,7 +110,7 @@ JS_ENUM_HEADER(TreeContextFlags, uint32_t) // This flag is *not* inherited by enclosed or enclosing functions; it // applies only to the function in whose flags it appears. // TCF_FUN_EXTENSIBLE_SCOPE = 0x100, TCF_FUN_EXTENSIBLE_SCOPE = 0x80, // Technically, every function has a binding named 'arguments'. Internally, // this binding is only added when 'arguments' is mentioned by the function Loading @@ -136,7 +133,7 @@ JS_ENUM_HEADER(TreeContextFlags, uint32_t) // have no special semantics: the initial value is unconditionally the // actual argument (or undefined if nactual < nformal). // TCF_ARGUMENTS_HAS_LOCAL_BINDING = 0x200, TCF_ARGUMENTS_HAS_LOCAL_BINDING = 0x100, // In many cases where 'arguments' has a local binding (as described above) // we do not need to actually create an arguments object in the function Loading @@ -147,7 +144,7 @@ JS_ENUM_HEADER(TreeContextFlags, uint32_t) // be unsound in several cases. The frontend filters out such cases by // setting this flag which eagerly sets script->needsArgsObj to true. // TCF_DEFINITELY_NEEDS_ARGS_OBJ = 0x400 TCF_DEFINITELY_NEEDS_ARGS_OBJ = 0x200 } JS_ENUM_FOOTER(TreeContextFlags); Loading