Bug 1168666 - Update assertions to allow export specs to contain batch exports r=waldo

This commit is contained in:
Jon Coppeard 2015-06-05 09:55:03 +01:00
parent 3d9b9475f3
commit bf0d9da2db
2 changed files with 11 additions and 3 deletions

View File

@ -710,14 +710,20 @@ class NameResolver
return false;
break;
// Import/export spec lists contain only import/export specs
// containing only pairs of names.
// Import/export spec lists contain import/export specs containing
// only pairs of names. Alternatively, an export spec lists may
// contain a single export batch specifier.
case PNK_IMPORT_SPEC_LIST: {
case PNK_EXPORT_SPEC_LIST:
MOZ_ASSERT(cur->isArity(PN_LIST));
#ifdef DEBUG
bool isImport = cur->isKind(PNK_IMPORT_SPEC_LIST);
for (ParseNode* item = cur->pn_head; item; item = item->pn_next) {
ParseNode* item = cur->pn_head;
if (!isImport && item && item->isKind(PNK_EXPORT_BATCH_SPEC)) {
MOZ_ASSERT(item->isArity(PN_NULLARY));
break;
}
for (; item; item = item->pn_next) {
MOZ_ASSERT(item->isKind(isImport ? PNK_IMPORT_SPEC : PNK_EXPORT_SPEC));
MOZ_ASSERT(item->isArity(PN_BINARY));
MOZ_ASSERT(item->pn_left->isKind(PNK_NAME));

View File

@ -0,0 +1,2 @@
// |jit-test| error: SyntaxError
export *