Add cases for division after a Block

Plus some line terminator checks
This commit is contained in:
Leo Balter 2019-07-16 18:39:56 -04:00 committed by Rick Waldron
parent a1f7142b89
commit edeada5376
5 changed files with 124 additions and 0 deletions

View File

@ -0,0 +1,27 @@
// Copyright (C) 2019 Leo Balter. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-multiplicative-operators-runtime-semantics-evaluation
description: Line terminator between the operands of a division operator
info: |
MultiplicativeExpression[Yield, Await]:
ExponentiationExpression
MultiplicativeExpression MultiplicativeOperator ExponentiationExpression
MultiplicativeOperator : one of
* / %
---*/
var x = 18
/
2
/
9
;
assert.sameValue(x, 1);

View File

@ -0,0 +1,21 @@
// Copyright (C) 2019 Leo Balter. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-multiplicative-operators-runtime-semantics-evaluation
description: division after block statement (no ASI)
info: |
MultiplicativeExpression[Yield, Await]:
ExponentiationExpression
MultiplicativeExpression MultiplicativeOperator ExponentiationExpression
MultiplicativeOperator : one of
* / %
---*/
var of = 4;
var g = 2;
var notRegExp = eval('{[42]}.8/of/g');
assert.sameValue(notRegExp, .1);

View File

@ -0,0 +1,22 @@
// Copyright (C) 2019 Leo Balter. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-multiplicative-operators-runtime-semantics-evaluation
description: No ASI happening in identifier used as operands
info: |
MultiplicativeExpression[Yield, Await]:
ExponentiationExpression
MultiplicativeExpression MultiplicativeOperator ExponentiationExpression
MultiplicativeOperator : one of
* / %
---*/
var instance = 60;
var of = 6;
var g = 2;
var notRegExp = instance/of/g;
assert.sameValue(notRegExp, 5);

View File

@ -0,0 +1,27 @@
// Copyright (C) 2019 Leo Balter. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-multiplicative-operators-runtime-semantics-evaluation
description: Line terminator between the operands of a modulus operator
info: |
MultiplicativeExpression[Yield, Await]:
ExponentiationExpression
MultiplicativeExpression MultiplicativeOperator ExponentiationExpression
MultiplicativeOperator : one of
* / %
---*/
var x = 18
%
7
%
3
;
assert.sameValue(x, 1);

View File

@ -0,0 +1,27 @@
// Copyright (C) 2019 Leo Balter. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-multiplicative-operators-runtime-semantics-evaluation
description: Line terminator between the operands of a multiplication operator
info: |
MultiplicativeExpression[Yield, Await]:
ExponentiationExpression
MultiplicativeExpression MultiplicativeOperator ExponentiationExpression
MultiplicativeOperator : one of
* / %
---*/
var x = 18
*
2
*
9
;
assert.sameValue(x, 324);