Specify an explicit offset when reporting an error for a for-of loop

whose target is an expression that begins with 'let'.
This commit is contained in:
wolfbeast 2019-04-06 10:47:27 +02:00 committed by Roy Tam
commit de1ec588d2

View file

@ -5536,7 +5536,7 @@ Parser<ParseHandler>::forHeadStart(YieldHandling yieldHandling,
//
// See ES6 13.7.
if (isForOf && letIsIdentifier) {
reportWithNode(ParseError, false, *forInitialPart, JSMSG_LET_STARTING_FOROF_LHS);
errorAt(exprOffset, JSMSG_LET_STARTING_FOROF_LHS);
return false;
}