| Index: src/scanner.cc
|
| diff --git a/src/scanner.cc b/src/scanner.cc
|
| index 8585e3836ecbf2a6663c4d88b37f337ff8b2a8eb..65ec0f8b7af0301becebfd74b70f3371f0c322a9 100644
|
| --- a/src/scanner.cc
|
| +++ b/src/scanner.cc
|
| @@ -384,7 +384,7 @@ uc32 Scanner::ScanHexEscape(uc32 c, int length) {
|
| for (int j = i-1; j >= 0; j--) {
|
| PushBack(digits[j]);
|
| }
|
| -
|
| + // Notice: No handling of error - treat it as "\u"->"u".
|
| return c;
|
| }
|
| x = x * 16 + d;
|
| @@ -829,8 +829,18 @@ bool Scanner::ScanRegExpPattern(bool seen_equal) {
|
| bool Scanner::ScanRegExpFlags() {
|
| // Scan regular expression flags.
|
| StartLiteral();
|
| - while (kIsIdentifierPart.get(c0_))
|
| + while (kIsIdentifierPart.get(c0_)) {
|
| + if (c0_ == '\\') {
|
| + uc32 c = ScanIdentifierUnicodeEscape();
|
| + if (c != static_cast<uc32>(unibrow::Utf8::kBadChar)) {
|
| + // We allow any escaped character, unlike the restriction on
|
| + // IdentifierPart when it is used to build an IdentifierName.
|
| + AddChar(c);
|
| + continue;
|
| + }
|
| + }
|
| AddCharAdvance();
|
| + }
|
| TerminateLiteral();
|
|
|
| next_.location.end_pos = source_pos() - 1;
|
|
|