Add tests for invalid BigInt MVs

This commit is contained in:
Leo Balter 2017-08-25 15:45:26 -04:00
parent d9f62e4ccf
commit bb9fc81101
No known key found for this signature in database
GPG Key ID: 2C75F319D398E36B
2 changed files with 54 additions and 0 deletions

View File

@ -0,0 +1,27 @@
// Copyright (C) 2017 The V8 Project authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-numeric-literal-static-semantics-early-errors
description: >
It is a Syntax Error if the MV is not an integer. (decimalIntegerLiteral dot decimalDigits)
info: |
Static Semantics: BigInt Value
NumericLiteral :: NumericLiteralBase NumericLiteralSuffix
1. Assert: NumericLiteralSuffix is n.
2. Let the value of NumericLiteral be the MV of NumericLiteralBase represented as BigInt.
DecimalLiteral ::
DecimalIntegerLiteral . DecimalDigits_opt
. DecimalDigits
features: [BigInt]
negative:
phase: early
type: SyntaxError
---*/
throw "Test262: This statement should not be evaluated.";
2017.8n;

View File

@ -0,0 +1,27 @@
// Copyright (C) 2017 The V8 Project authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-numeric-literal-static-semantics-early-errors
description: >
It is a Syntax Error if the MV is not an integer. (dot decimalDigits)
info: |
Static Semantics: BigInt Value
NumericLiteral :: NumericLiteralBase NumericLiteralSuffix
1. Assert: NumericLiteralSuffix is n.
2. Let the value of NumericLiteral be the MV of NumericLiteralBase represented as BigInt.
DecimalLiteral ::
DecimalIntegerLiteral . DecimalDigits_opt
. DecimalDigits
features: [BigInt]
negative:
phase: early
type: SyntaxError
---*/
throw "Test262: This statement should not be evaluated.";
.0000000001n;