e3d761d94b
ParserBase::is_any_identifier currently does not recognise Token::ESCAPED_STRICT_RESERVED_WORD as an identifier. This seems different from what ParserBase::ParseIdentifierName does, and also prevents "l\u0065t", unlike "let", from becoming a label. This CL extends is_any_identifier to also accept ESCAPED_STRICT_RESERVED_WORD. BUG=v8:5692 Review-Url: https://codereview.chromium.org/2695973003 Cr-Commit-Position: refs/heads/master@{#43204}
17 lines
470 B
JavaScript
17 lines
470 B
JavaScript
// Copyright 2017 the V8 project authors. All rights reserved.
|
|
// Use of this source code is governed by a BSD-style license that can be
|
|
// found in the LICENSE file.
|
|
|
|
// "let" in non-strict mode can be a label, even if composed of unicode escape
|
|
// sequences.
|
|
|
|
var wasTouched = false;
|
|
l\u0065t:
|
|
do {
|
|
break l\u0065t;
|
|
wasTouched = true;
|
|
} while (false);
|
|
// Verify that in addition to no exception thrown, breaking to the label also
|
|
// works.
|
|
assertFalse(wasTouched);
|