mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-28 15:24:43 +02:00
8188098: NPE in SimpleTreeVisitorES6 visitor when parsing a tagged template literal
Reviewed-by: hannesw, jlaskey
This commit is contained in:
parent
b0e9c95b72
commit
cea7897f08
3 changed files with 106 additions and 2 deletions
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue