зеркало из https://github.com/mozilla/pjs.git
Fix hard case of formal param and local function with same name (299639, r=shaver).
This commit is contained in:
Родитель
e9a2b70fb2
Коммит
8ec65a71e9
|
@ -2905,6 +2905,7 @@ js_EmitTree(JSContext *cx, JSCodeGenerator *cg, JSParseNode *pn)
|
|||
if (cg->treeContext.flags & TCF_IN_FUNCTION) {
|
||||
JSObject *obj, *pobj;
|
||||
JSProperty *prop;
|
||||
JSScopeProperty *sprop;
|
||||
uintN slot;
|
||||
|
||||
obj = OBJ_GET_PARENT(cx, fun->object);
|
||||
|
@ -2912,8 +2913,11 @@ js_EmitTree(JSContext *cx, JSCodeGenerator *cg, JSParseNode *pn)
|
|||
&pobj, &prop)) {
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
JS_ASSERT(prop && pobj == obj);
|
||||
slot = ((JSScopeProperty *) prop)->shortid;
|
||||
sprop = (JSScopeProperty *) prop;
|
||||
JS_ASSERT(sprop->getter == js_GetLocalVariable);
|
||||
slot = sprop->shortid;
|
||||
OBJ_DROP_PROPERTY(cx, pobj, prop);
|
||||
|
||||
if (atomIndex >= JS_BIT(16)) {
|
||||
|
|
|
@ -830,7 +830,9 @@ FunctionDef(JSContext *cx, JSTokenStream *ts, JSTreeContext *tc,
|
|||
}
|
||||
if (prop)
|
||||
OBJ_DROP_PROPERTY(cx, pobj, prop);
|
||||
if (!prop || pobj != varobj) {
|
||||
if (!prop ||
|
||||
pobj != varobj ||
|
||||
((JSScopeProperty *)prop)->getter != js_GetLocalVariable) {
|
||||
if (!js_AddHiddenProperty(cx, varobj, ATOM_TO_JSID(funAtom),
|
||||
js_GetLocalVariable,
|
||||
js_SetLocalVariable,
|
||||
|
|
Загрузка…
Ссылка в новой задаче