Add tests for BigInt disallowed in LegacyOctalLike and NonOctal literals (#2253)

Ref https://github.com/tc39/proposal-bigint/issues/208
This commit is contained in:
Leo Balter 2019-07-23 01:41:26 -04:00 committed by GitHub
parent 7f1116982d
commit 1affd0ccd5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 196 additions and 0 deletions

View File

@ -0,0 +1,28 @@
// Copyright (C) 2019 Leo Balter. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: prod-NumericLiteral
description: >
The BigInt suffix is disallowed in LegacyOctalIntegerLiteral
info: |
NumericLiteral ::
DecimalIntegerLiteral BigIntLiteralSuffix
NumericLiteralBase BigIntLiteralSuffix
LegacyOctalIntegerLiteral
NumericLiteralBase ::
BinaryIntegerLiteral
OctalIntegerLiteral
HexIntegerLiteral
BigIntLiteralSuffix :: n
features: [BigInt]
negative:
phase: parse
type: SyntaxError
---*/
$DONOTEVALUATE();
00n;

View File

@ -0,0 +1,28 @@
// Copyright (C) 2019 Leo Balter. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: prod-NumericLiteral
description: >
The BigInt suffix is disallowed in LegacyOctalIntegerLiteral
info: |
NumericLiteral ::
DecimalIntegerLiteral BigIntLiteralSuffix
NumericLiteralBase BigIntLiteralSuffix
LegacyOctalIntegerLiteral
NumericLiteralBase ::
BinaryIntegerLiteral
OctalIntegerLiteral
HexIntegerLiteral
BigIntLiteralSuffix :: n
features: [BigInt]
negative:
phase: parse
type: SyntaxError
---*/
$DONOTEVALUATE();
01n;

View File

@ -0,0 +1,28 @@
// Copyright (C) 2019 Leo Balter. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: prod-NumericLiteral
description: >
The BigInt suffix is disallowed in LegacyOctalIntegerLiteral
info: |
NumericLiteral ::
DecimalIntegerLiteral BigIntLiteralSuffix
NumericLiteralBase BigIntLiteralSuffix
LegacyOctalIntegerLiteral
NumericLiteralBase ::
BinaryIntegerLiteral
OctalIntegerLiteral
HexIntegerLiteral
BigIntLiteralSuffix :: n
features: [BigInt]
negative:
phase: parse
type: SyntaxError
---*/
$DONOTEVALUATE();
07n;

View File

@ -0,0 +1,28 @@
// Copyright (C) 2019 Leo Balter. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: prod-NumericLiteral
description: >
The BigInt suffix is disallowed in NonOctalDecimalIntegerLiteral
info: |
NumericLiteral ::
DecimalIntegerLiteral BigIntLiteralSuffix
https://github.com/tc39/proposal-bigint/issues/208
NumericLiteral ::
DecimalBigIntegerLiteral
DecimalBigIntegerLiteral ::
0 BigIntLiteralSuffix
NonZeroDigit DecimalDigits_opt BigIntLiteralSuffix
features: [BigInt]
negative:
phase: parse
type: SyntaxError
---*/
$DONOTEVALUATE();
0008n;

View File

@ -0,0 +1,28 @@
// Copyright (C) 2019 Leo Balter. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: prod-NumericLiteral
description: >
The BigInt suffix is disallowed in NonOctalDecimalIntegerLiteral
info: |
NumericLiteral ::
DecimalIntegerLiteral BigIntLiteralSuffix
https://github.com/tc39/proposal-bigint/issues/208
NumericLiteral ::
DecimalBigIntegerLiteral
DecimalBigIntegerLiteral ::
0 BigIntLiteralSuffix
NonZeroDigit DecimalDigits_opt BigIntLiteralSuffix
features: [BigInt]
negative:
phase: parse
type: SyntaxError
---*/
$DONOTEVALUATE();
012348n;

View File

@ -0,0 +1,28 @@
// Copyright (C) 2019 Leo Balter. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: prod-NumericLiteral
description: >
The BigInt suffix is disallowed in NonOctalDecimalIntegerLiteral
info: |
NumericLiteral ::
DecimalIntegerLiteral BigIntLiteralSuffix
https://github.com/tc39/proposal-bigint/issues/208
NumericLiteral ::
DecimalBigIntegerLiteral
DecimalBigIntegerLiteral ::
0 BigIntLiteralSuffix
NonZeroDigit DecimalDigits_opt BigIntLiteralSuffix
features: [BigInt]
negative:
phase: parse
type: SyntaxError
---*/
$DONOTEVALUATE();
08n;

View File

@ -0,0 +1,28 @@
// Copyright (C) 2019 Leo Balter. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: prod-NumericLiteral
description: >
The BigInt suffix is disallowed in NonOctalDecimalIntegerLiteral
info: |
NumericLiteral ::
DecimalIntegerLiteral BigIntLiteralSuffix
https://github.com/tc39/proposal-bigint/issues/208
NumericLiteral ::
DecimalBigIntegerLiteral
DecimalBigIntegerLiteral ::
0 BigIntLiteralSuffix
NonZeroDigit DecimalDigits_opt BigIntLiteralSuffix
features: [BigInt]
negative:
phase: parse
type: SyntaxError
---*/
$DONOTEVALUATE();
09n;