mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-12-02 01:48:05 +00:00
Bug 1501537 - Name function in variable declaration initializer in BinAST. r=Yoric
This commit is contained in:
parent
3cec62da42
commit
b5cfef2126
@ -5061,11 +5061,11 @@ BinASTParser<Tok>::parseInterfaceVariableDeclarator(const size_t start, const Bi
|
||||
ParseNode* result;
|
||||
if (binding->isKind(ParseNodeKind::Name)) {
|
||||
// `var foo [= bar]``
|
||||
MOZ_TRY(checkBinding(binding->template as<NameNode>().atom()->asPropertyName()));
|
||||
|
||||
BINJS_TRY_VAR(result, factory_.newName(binding->template as<NameNode>().atom()->asPropertyName(), tokenizer_->pos(start), cx_));
|
||||
NameNode* bindingNameNode = &binding->template as<NameNode>();
|
||||
MOZ_TRY(checkBinding(bindingNameNode->atom()->asPropertyName()));
|
||||
result = bindingNameNode;
|
||||
if (init) {
|
||||
result->as<NameNode>().setInitializer(init);
|
||||
BINJS_TRY(factory_.finishInitializerAssignment(bindingNameNode, init));
|
||||
}
|
||||
} else {
|
||||
// `var pattern = bar`
|
||||
|
@ -1347,11 +1347,11 @@ VariableDeclarator:
|
||||
ParseNode* result;
|
||||
if (binding->isKind(ParseNodeKind::Name)) {
|
||||
// `var foo [= bar]``
|
||||
MOZ_TRY(checkBinding(binding->template as<NameNode>().atom()->asPropertyName()));
|
||||
|
||||
BINJS_TRY_VAR(result, factory_.newName(binding->template as<NameNode>().atom()->asPropertyName(), tokenizer_->pos(start), cx_));
|
||||
NameNode* bindingNameNode = &binding->template as<NameNode>();
|
||||
MOZ_TRY(checkBinding(bindingNameNode->atom()->asPropertyName()));
|
||||
result = bindingNameNode;
|
||||
if (init) {
|
||||
result->as<NameNode>().setInitializer(init);
|
||||
BINJS_TRY(factory_.finishInitializerAssignment(bindingNameNode, init));
|
||||
}
|
||||
} else {
|
||||
// `var pattern = bar`
|
||||
|
Loading…
Reference in New Issue
Block a user