Move some AnnexB tests per proposed spec change

Additionally, update test metadata and introduce two new tests to
complete coverage.

Reference: "Normative: Make B.1.{1,2} normative"
https://github.com/tc39/ecma262/pull/1867
This commit is contained in:
Mike Pennisi 2021-05-13 21:49:01 -04:00 committed by Rick Waldron
parent 5e0fc43c66
commit d454b8389b
24 changed files with 172 additions and 86 deletions

View File

@ -20,8 +20,8 @@ info: |
ZeroToThree OctalDigit OctalDigit ZeroToThree OctalDigit OctalDigit
The production CharacterEscape :: LegacyOctalEscapeSequence evaluates by The production CharacterEscape :: LegacyOctalEscapeSequence evaluates by
evaluating the SV of the LegacyOctalEscapeSequence (see B.1.2) and evaluating the SV of the LegacyOctalEscapeSequence and returning its
returning its character result. character result.
---*/ ---*/
assert.sameValue(/\1/.exec('\x01')[0], '\x01', '\\1'); assert.sameValue(/\1/.exec('\x01')[0], '\x01', '\\1');

View File

@ -5,8 +5,18 @@ esid: sec-template-literal-lexical-components
description: > description: >
Invalid octal escape sequence (regardless of the presence of Annex B) Invalid octal escape sequence (regardless of the presence of Annex B)
info: | info: |
A conforming implementation must not use the extended definition of TemplateCharacter ::
EscapeSequence described in B.1.2 when parsing a TemplateCharacter. $ [lookahead {]
\ TemplateEscapeSequence
\ NotEscapeSequence
LineContinuation
LineTerminatorSequence
SourceCharacter but not one of ` or \ or $ or LineTerminator
TemplateEscapeSequence ::
CharacterEscapeSequence
0 [lookahead DecimalDigit]
HexEscapeSequence
UnicodeEscapeSequence
negative: negative:
phase: parse phase: parse
type: SyntaxError type: SyntaxError

View File

@ -5,8 +5,18 @@ esid: sec-template-literal-lexical-components
description: > description: >
Invalid octal escape sequence (regardless of the presence of Annex B) Invalid octal escape sequence (regardless of the presence of Annex B)
info: | info: |
A conforming implementation must not use the extended definition of TemplateCharacter ::
EscapeSequence described in B.1.2 when parsing a TemplateCharacter. $ [lookahead {]
\ TemplateEscapeSequence
\ NotEscapeSequence
LineContinuation
LineTerminatorSequence
SourceCharacter but not one of ` or \ or $ or LineTerminator
TemplateEscapeSequence ::
CharacterEscapeSequence
0 [lookahead DecimalDigit]
HexEscapeSequence
UnicodeEscapeSequence
negative: negative:
phase: parse phase: parse
type: SyntaxError type: SyntaxError

View File

@ -4,8 +4,18 @@
es6id: 16.1 es6id: 16.1
description: Invalid octal escape sequence description: Invalid octal escape sequence
info: | info: |
TemplateCharacter (11.8.6) must not be extended to include TemplateCharacter ::
LegacyOctalEscapeSequence as defined in B.1.2. $ [lookahead {]
\ TemplateEscapeSequence
\ NotEscapeSequence
LineContinuation
LineTerminatorSequence
SourceCharacter but not one of ` or \ or $ or LineTerminator
TemplateEscapeSequence ::
CharacterEscapeSequence
0 [lookahead DecimalDigit]
HexEscapeSequence
UnicodeEscapeSequence
negative: negative:
phase: parse phase: parse
type: SyntaxError type: SyntaxError

View File

@ -1,7 +1,7 @@
// Copyright (C) 2016 the V8 project authors. All rights reserved. // Copyright (C) 2016 the V8 project authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file. // This code is governed by the BSD license found in the LICENSE file.
/*--- /*---
esid: sec-additional-syntax-numeric-literals esid: sec-literals-numeric-literals
description: LegacyOctalIntegerLiteral is not enabled in strict mode code description: LegacyOctalIntegerLiteral is not enabled in strict mode code
info: | info: |
NumericLiteral :: NumericLiteral ::
@ -14,6 +14,14 @@ info: |
LegacyOctalIntegerLiteral :: LegacyOctalIntegerLiteral ::
0 OctalDigit 0 OctalDigit
LegacyOctalIntegerLiteral OctalDigit LegacyOctalIntegerLiteral OctalDigit
## 12.8.3.1 Static Semantics: Early Errors
NumericLiteral :: LegacyOctalIntegerLiteral
DecimalIntegerLiteral :: NonOctalDecimalIntegerLiteral
- It is a Syntax Error if the source code matching this production is
strict mode code.
flags: [onlyStrict] flags: [onlyStrict]
negative: negative:
phase: parse phase: parse

View File

@ -1,7 +1,7 @@
// Copyright (C) 2016 the V8 project authors. All rights reserved. // Copyright (C) 2016 the V8 project authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file. // This code is governed by the BSD license found in the LICENSE file.
/*--- /*---
esid: sec-additional-syntax-numeric-literals esid: sec-literals-numeric-literals
description: Mathematical value for LegacyOctalIntegerLiteral description: Mathematical value for LegacyOctalIntegerLiteral
info: | info: |
NumericLiteral :: NumericLiteral ::

View File

@ -1,7 +1,7 @@
// Copyright (C) 2016 the V8 project authors. All rights reserved. // Copyright (C) 2016 the V8 project authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file. // This code is governed by the BSD license found in the LICENSE file.
/*--- /*---
esid: sec-additional-syntax-numeric-literals esid: sec-literals-numeric-literals
description: NonOctalDecimalIntegerLiteral is not enabled in strict mode code description: NonOctalDecimalIntegerLiteral is not enabled in strict mode code
info: | info: |
DecimalIntegerLiteral :: DecimalIntegerLiteral ::
@ -20,6 +20,14 @@ info: |
NonOctalDigit :: one of NonOctalDigit :: one of
8 9 8 9
## 12.8.3.1 Static Semantics: Early Errors
NumericLiteral :: LegacyOctalIntegerLiteral
DecimalIntegerLiteral :: NonOctalDecimalIntegerLiteral
- It is a Syntax Error if the source code matching this production is
strict mode code.
flags: [onlyStrict] flags: [onlyStrict]
negative: negative:
phase: parse phase: parse

View File

@ -1,7 +1,7 @@
// Copyright (C) 2016 the V8 project authors. All rights reserved. // Copyright (C) 2016 the V8 project authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file. // This code is governed by the BSD license found in the LICENSE file.
/*--- /*---
esid: sec-additional-syntax-numeric-literals esid: sec-literals-numeric-literals
description: Mathematical value for NonOctalDecimalIntegerLiteral description: Mathematical value for NonOctalDecimalIntegerLiteral
info: | info: |
DecimalIntegerLiteral :: DecimalIntegerLiteral ::

View File

@ -1,7 +1,7 @@
// Copyright (C) 2020 Rick Waldron Inc. All rights reserved. // Copyright (C) 2020 Rick Waldron Inc. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file. // This code is governed by the BSD license found in the LICENSE file.
/*--- /*---
esid: sec-additional-syntax-string-literals esid: sec-literals-string-literals
description: > description: >
String Literals extensions disallowed in strict mode; ZeroToThree 1 String Literals extensions disallowed in strict mode; ZeroToThree 1
info: | info: |

View File

@ -1,7 +1,7 @@
// Copyright (C) 2020 Rick Waldron Inc. All rights reserved. // Copyright (C) 2020 Rick Waldron Inc. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file. // This code is governed by the BSD license found in the LICENSE file.
/*--- /*---
esid: sec-additional-syntax-string-literals esid: sec-literals-string-literals
description: > description: >
String Literals extensions disallowed in strict mode; ZeroToThree 2 String Literals extensions disallowed in strict mode; ZeroToThree 2
info: | info: |

View File

@ -1,7 +1,7 @@
// Copyright (C) 2020 Rick Waldron Inc. All rights reserved. // Copyright (C) 2020 Rick Waldron Inc. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file. // This code is governed by the BSD license found in the LICENSE file.
/*--- /*---
esid: sec-additional-syntax-string-literals esid: sec-literals-string-literals
description: > description: >
String Literals extensions disallowed in strict mode; ZeroToThree 3 String Literals extensions disallowed in strict mode; ZeroToThree 3
info: | info: |

View File

@ -1,7 +1,7 @@
// Copyright (C) 2020 Rick Waldron Inc. All rights reserved. // Copyright (C) 2020 Rick Waldron Inc. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file. // This code is governed by the BSD license found in the LICENSE file.
/*--- /*---
esid: sec-additional-syntax-string-literals esid: sec-literals-string-literals
description: > description: >
String Literals extensions disallowed in strict mode; FourToSeven 4 String Literals extensions disallowed in strict mode; FourToSeven 4
info: | info: |

View File

@ -1,7 +1,7 @@
// Copyright (C) 2020 Rick Waldron Inc. All rights reserved. // Copyright (C) 2020 Rick Waldron Inc. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file. // This code is governed by the BSD license found in the LICENSE file.
/*--- /*---
esid: sec-additional-syntax-string-literals esid: sec-literals-string-literals
description: > description: >
String Literals extensions disallowed in strict mode; FourToSeven 5 String Literals extensions disallowed in strict mode; FourToSeven 5
info: | info: |

View File

@ -1,7 +1,7 @@
// Copyright (C) 2020 Rick Waldron Inc. All rights reserved. // Copyright (C) 2020 Rick Waldron Inc. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file. // This code is governed by the BSD license found in the LICENSE file.
/*--- /*---
esid: sec-additional-syntax-string-literals esid: sec-literals-string-literals
description: > description: >
String Literals extensions disallowed in strict mode; FourToSeven 6 String Literals extensions disallowed in strict mode; FourToSeven 6
info: | info: |

View File

@ -1,7 +1,7 @@
// Copyright (C) 2020 Rick Waldron Inc. All rights reserved. // Copyright (C) 2020 Rick Waldron Inc. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file. // This code is governed by the BSD license found in the LICENSE file.
/*--- /*---
esid: sec-additional-syntax-string-literals esid: sec-literals-string-literals
description: > description: >
String Literals extensions disallowed in strict mode; FourToSeven 7 String Literals extensions disallowed in strict mode; FourToSeven 7
info: | info: |

View File

@ -0,0 +1,19 @@
// Copyright (C) 2021 the V8 project authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-literals-string-literals
description: LegacyOctalEscapeSequence is not available in non-strict code - 8
info: |
EscapeSequence ::
CharacterEscapeSequence
LegacyOctalEscapeSequence
NonOctalDecimalEscapeSequence
HexEscapeSequence
UnicodeEscapeSequence
NonOctalDecimalEscapeSequence :: one of
8 9
flags: [noStrict]
---*/
assert.sameValue('\8', '8');

View File

@ -1,7 +1,7 @@
// Copyright (C) 2020 Rick Waldron Inc. All rights reserved. // Copyright (C) 2020 Rick Waldron Inc. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file. // This code is governed by the BSD license found in the LICENSE file.
/*--- /*---
esid: sec-additional-syntax-string-literals esid: sec-literals-string-literals
description: > description: >
String Literals extensions disallowed in strict mode; NonOctalDecimalEscapeSequence 8 String Literals extensions disallowed in strict mode; NonOctalDecimalEscapeSequence 8
info: | info: |

View File

@ -2,12 +2,24 @@
// This code is governed by the BSD license found in the LICENSE file. // This code is governed by the BSD license found in the LICENSE file.
/*--- /*---
esid: sec-literals-string-literals esid: sec-literals-string-literals
description: > description: LegacyOctalEscapeSequence is not enabled in strict mode code - 8
LegacyOctalEscapeSequence is not enabled in strict mode code
(regardless of the presence of Annex B)
info: | info: |
A conforming implementation, when processing strict mode code, must not extend the EscapeSequence ::
syntax of EscapeSequence to include LegacyOctalEscapeSequence as described in B.1.2. CharacterEscapeSequence
LegacyOctalEscapeSequence
NonOctalDecimalEscapeSequence
HexEscapeSequence
UnicodeEscapeSequence
NonOctalDecimalEscapeSequence :: one of
8 9
## 12.8.4.1 Static Semantics: Early Errors
EscapeSequence :: NonOctalDecimalEscapeSequence
- It is a Syntax Error if the source code matching this production is strict
mode code.
flags: [onlyStrict] flags: [onlyStrict]
negative: negative:
phase: parse phase: parse

View File

@ -0,0 +1,19 @@
// Copyright (C) 2021 the V8 project authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-literals-string-literals
description: LegacyOctalEscapeSequence is not available in non-strict code - 9
info: |
EscapeSequence ::
CharacterEscapeSequence
LegacyOctalEscapeSequence
NonOctalDecimalEscapeSequence
HexEscapeSequence
UnicodeEscapeSequence
NonOctalDecimalEscapeSequence :: one of
8 9
flags: [noStrict]
---*/
assert.sameValue('\9', '9');

View File

@ -1,7 +1,7 @@
// Copyright (C) 2020 Rick Waldron Inc. All rights reserved. // Copyright (C) 2020 Rick Waldron Inc. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file. // This code is governed by the BSD license found in the LICENSE file.
/*--- /*---
esid: sec-additional-syntax-string-literals esid: sec-literals-string-literals
description: > description: >
String Literals extensions disallowed in strict mode; NonOctalDecimalEscapeSequence 9 String Literals extensions disallowed in strict mode; NonOctalDecimalEscapeSequence 9
info: | info: |

View File

@ -2,12 +2,24 @@
// This code is governed by the BSD license found in the LICENSE file. // This code is governed by the BSD license found in the LICENSE file.
/*--- /*---
esid: sec-literals-string-literals esid: sec-literals-string-literals
description: > description: LegacyOctalEscapeSequence is not enabled in strict mode code - 9
LegacyOctalEscapeSequence is not enabled in strict mode code
(regardless of the presence of Annex B)
info: | info: |
A conforming implementation, when processing strict mode code, must not extend the EscapeSequence ::
syntax of EscapeSequence to include LegacyOctalEscapeSequence as described in B.1.2. CharacterEscapeSequence
LegacyOctalEscapeSequence
NonOctalDecimalEscapeSequence
HexEscapeSequence
UnicodeEscapeSequence
NonOctalDecimalEscapeSequence :: one of
8 9
## 12.8.4.1 Static Semantics: Early Errors
EscapeSequence :: NonOctalDecimalEscapeSequence
- It is a Syntax Error if the source code matching this production is strict
mode code.
flags: [onlyStrict] flags: [onlyStrict]
negative: negative:
phase: parse phase: parse

View File

@ -1,32 +1,21 @@
// Copyright (C) 2017 Kevin Gibbons. All rights reserved. // Copyright (C) 2017 Kevin Gibbons. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file. // This code is governed by the BSD license found in the LICENSE file.
/*--- /*---
esid: sec-additional-syntax-string-literals esid: sec-template-literal-lexical-components
es6id: B.1.2 description: LegacyOctalEscapeSequence is not available in template literals
description: >
LegacyOctalEscapeSequence is not enabled in strict mode code (regardless of
the presence of Annex B)
info: | info: |
EscapeSequence :: TemplateCharacter ::
$ [lookahead {]
\ TemplateEscapeSequence
\ NotEscapeSequence
LineContinuation
LineTerminatorSequence
SourceCharacter but not one of ` or \ or $ or LineTerminator
TemplateEscapeSequence ::
CharacterEscapeSequence CharacterEscapeSequence
LegacyOctalEscapeSequence 0 [lookahead DecimalDigit]
HexEscapeSequence HexEscapeSequence
UnicodeEscapeSequence UnicodeEscapeSequence
LegacyOctalEscapeSequence ::
OctalDigit [lookahead OctalDigit]
ZeroToThree OctalDigit [lookahead OctalDigit]
FourToSeven OctalDigit
ZeroToThree OctalDigit OctalDigit
ZeroToThree :: one of
0 1 2 3
FourToSeven :: one of
4 5 6 7
This definition of EscapeSequence is not used in strict mode or when
parsing TemplateCharacter.
flags: [onlyStrict] flags: [onlyStrict]
negative: negative:
phase: parse phase: parse

View File

@ -1,32 +1,21 @@
// Copyright (C) 2016 the V8 project authors. All rights reserved. // Copyright (C) 2016 the V8 project authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file. // This code is governed by the BSD license found in the LICENSE file.
/*--- /*---
esid: sec-additional-syntax-string-literals esid: sec-template-literal-lexical-components
es6id: B.1.2 description: LegacyOctalEscapeSequence is not available in template literals
description: >
LegacyOctalEscapeSequence is not enabled in strict mode code (regardless of
the presence of Annex B)
info: | info: |
EscapeSequence :: TemplateCharacter ::
$ [lookahead {]
\ TemplateEscapeSequence
\ NotEscapeSequence
LineContinuation
LineTerminatorSequence
SourceCharacter but not one of ` or \ or $ or LineTerminator
TemplateEscapeSequence ::
CharacterEscapeSequence CharacterEscapeSequence
LegacyOctalEscapeSequence 0 [lookahead DecimalDigit]
HexEscapeSequence HexEscapeSequence
UnicodeEscapeSequence UnicodeEscapeSequence
LegacyOctalEscapeSequence ::
OctalDigit [lookahead OctalDigit]
ZeroToThree OctalDigit [lookahead OctalDigit]
FourToSeven OctalDigit
ZeroToThree OctalDigit OctalDigit
ZeroToThree :: one of
0 1 2 3
FourToSeven :: one of
4 5 6 7
This definition of EscapeSequence is not used in strict mode or when
parsing TemplateCharacter.
flags: [onlyStrict] flags: [onlyStrict]
negative: negative:
phase: parse phase: parse

View File

@ -1,13 +1,13 @@
// Copyright (C) 2016 the V8 project authors. All rights reserved. // Copyright (C) 2016 the V8 project authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file. // This code is governed by the BSD license found in the LICENSE file.
/*--- /*---
esid: sec-additional-syntax-string-literals esid: sec-literals-string-literals
es6id: B.1.2
description: String value for LegacyOctalEscapeSequence description: String value for LegacyOctalEscapeSequence
info: | info: |
EscapeSequence :: EscapeSequence ::
CharacterEscapeSequence CharacterEscapeSequence
LegacyOctalEscapeSequence LegacyOctalEscapeSequence
NonOctalDecimalEscapeSequence
HexEscapeSequence HexEscapeSequence
UnicodeEscapeSequence UnicodeEscapeSequence