8188098: NPE in SimpleTreeVisitorES6 visitor when parsing a tagged template literal

Reviewed-by: hannesw, jlaskey
This commit is contained in:
Athijegannathan Sundararajan 2017-09-28 23:03:17 +05:30
parent b0e9c95b72
commit cea7897f08
3 changed files with 106 additions and 2 deletions

View file

@ -5109,8 +5109,13 @@ public class Parser extends AbstractParser implements Loggable {
final LiteralNode<Expression[]> rawStringArray = LiteralNode.newInstance(templateToken, finish, rawStrings);
final LiteralNode<Expression[]> cookedStringArray = LiteralNode.newInstance(templateToken, finish, cookedStrings);
final RuntimeNode templateObject = new RuntimeNode(templateToken, finish, RuntimeNode.Request.GET_TEMPLATE_OBJECT, rawStringArray, cookedStringArray);
argumentList.set(0, templateObject);
if (!env._parse_only) {
final RuntimeNode templateObject = new RuntimeNode(templateToken, finish, RuntimeNode.Request.GET_TEMPLATE_OBJECT, rawStringArray, cookedStringArray);
argumentList.set(0, templateObject);
} else {
argumentList.set(0, rawStringArray);
}
return optimizeList(argumentList);
}