From bb9fc811015a21b6a3f3ae55369f0557620b4db0 Mon Sep 17 00:00:00 2001 From: Leo Balter Date: Fri, 25 Aug 2017 15:45:26 -0400 Subject: [PATCH] Add tests for invalid BigInt MVs --- .../bigint/mv-is-not-integer-dil-dot-dds.js | 27 +++++++++++++++++++ .../bigint/mv-is-not-integer-dot-dds.js | 27 +++++++++++++++++++ 2 files changed, 54 insertions(+) create mode 100644 test/language/literals/bigint/mv-is-not-integer-dil-dot-dds.js create mode 100644 test/language/literals/bigint/mv-is-not-integer-dot-dds.js diff --git a/test/language/literals/bigint/mv-is-not-integer-dil-dot-dds.js b/test/language/literals/bigint/mv-is-not-integer-dil-dot-dds.js new file mode 100644 index 0000000000..5c0a3492ff --- /dev/null +++ b/test/language/literals/bigint/mv-is-not-integer-dil-dot-dds.js @@ -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; diff --git a/test/language/literals/bigint/mv-is-not-integer-dot-dds.js b/test/language/literals/bigint/mv-is-not-integer-dot-dds.js new file mode 100644 index 0000000000..d5b605b809 --- /dev/null +++ b/test/language/literals/bigint/mv-is-not-integer-dot-dds.js @@ -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;