mirror of https://github.com/tc39/test262.git
Add cases for division after a Block
Plus some line terminator checks
This commit is contained in:
parent
a1f7142b89
commit
edeada5376
|
@ -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);
|
|
@ -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);
|
|
@ -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);
|
|
@ -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);
|
|
@ -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);
|
Loading…
Reference in New Issue