mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1165456
- Final bits of name-resolution by kind. r=shu
This commit is contained in:
parent
9265996a8c
commit
4a5ff0dc1f
@ -650,6 +650,8 @@ class NameResolver
|
||||
case PNK_GENEXP:
|
||||
case PNK_ARRAY:
|
||||
case PNK_STATEMENTLIST:
|
||||
case PNK_SEQ:
|
||||
case PNK_ARGSBODY:
|
||||
// Initializers for individual variables, and computed property names
|
||||
// within destructuring patterns, may contain unnamed functions.
|
||||
case PNK_VAR:
|
||||
@ -663,6 +665,17 @@ class NameResolver
|
||||
}
|
||||
goto done;
|
||||
|
||||
// Array comprehension nodes are lists with a single child -- PNK_FOR for
|
||||
// comprehensions, PNK_LEXICALSCOPE for legacy comprehensions. Probably
|
||||
// this should be a non-list eventually.
|
||||
case PNK_ARRAYCOMP:
|
||||
MOZ_ASSERT(cur->isArity(PN_LIST));
|
||||
MOZ_ASSERT(cur->pn_count == 1);
|
||||
MOZ_ASSERT(cur->pn_head->isKind(PNK_LEXICALSCOPE) || cur->pn_head->isKind(PNK_FOR));
|
||||
if (!resolve(cur->pn_head, prefix))
|
||||
return false;
|
||||
goto done;
|
||||
|
||||
case PNK_OBJECT:
|
||||
case PNK_CLASSMETHODLIST:
|
||||
MOZ_ASSERT(cur->isArity(PN_LIST));
|
||||
@ -705,16 +718,31 @@ class NameResolver
|
||||
goto done;
|
||||
}
|
||||
|
||||
case PNK_CATCHLIST:
|
||||
case PNK_SEQ:
|
||||
case PNK_ARGSBODY:
|
||||
case PNK_CATCHLIST: {
|
||||
MOZ_ASSERT(cur->isArity(PN_LIST));
|
||||
for (ParseNode* catchNode = cur->pn_head; catchNode; catchNode = catchNode->pn_next) {
|
||||
MOZ_ASSERT(catchNode->isKind(PNK_LEXICALSCOPE));
|
||||
MOZ_ASSERT(catchNode->expr()->isKind(PNK_CATCH));
|
||||
MOZ_ASSERT(catchNode->expr()->isArity(PN_TERNARY));
|
||||
if (!resolve(catchNode->expr(), prefix))
|
||||
return false;
|
||||
}
|
||||
goto done;
|
||||
}
|
||||
|
||||
case PNK_LABEL:
|
||||
case PNK_DOT:
|
||||
MOZ_ASSERT(cur->isArity(PN_NAME));
|
||||
if (!resolve(cur->expr(), prefix))
|
||||
return false;
|
||||
goto done;
|
||||
|
||||
case PNK_LEXICALSCOPE:
|
||||
case PNK_ARRAYCOMP:
|
||||
case PNK_NAME:
|
||||
case PNK_CLASSNAMES:
|
||||
break; // for now
|
||||
MOZ_ASSERT(cur->isArity(PN_NAME));
|
||||
if (!resolve(cur->maybeExpr(), prefix))
|
||||
return false;
|
||||
goto done;
|
||||
|
||||
case PNK_FUNCTION:
|
||||
MOZ_ASSERT(cur->isArity(PN_CODE));
|
||||
@ -727,6 +755,7 @@ class NameResolver
|
||||
case PNK_IMPORT_SPEC: // by PNK_IMPORT_SPEC_LIST
|
||||
case PNK_EXPORT_SPEC: // by PNK_EXPORT_SPEC_LIST
|
||||
case PNK_CALLSITEOBJ: // by PNK_TAGGED_TEMPLATE
|
||||
case PNK_CLASSNAMES: // by PNK_CLASS
|
||||
MOZ_CRASH("should have been handled by a parent node");
|
||||
|
||||
case PNK_LIMIT: // invalid sentinel value
|
||||
|
Loading…
Reference in New Issue
Block a user