2011-09-07 08:35:18 +02:00
|
|
|
|
// Copyright 2009 the Sputnik authors. All rights reserved.
|
|
|
|
|
// This code is governed by the BSD license found in the LICENSE file.
|
|
|
|
|
|
2014-07-22 01:09:02 +02:00
|
|
|
|
/*---
|
2018-01-05 18:26:51 +01:00
|
|
|
|
info: |
|
2014-07-22 01:09:02 +02:00
|
|
|
|
White Space and Line Terminator between LeftHandSideExpression and "@="
|
|
|
|
|
or between "@=" and AssignmentExpression are allowed
|
2014-07-25 00:41:42 +02:00
|
|
|
|
es5id: 11.13.2_A1_T6
|
2018-10-08 00:49:38 +02:00
|
|
|
|
esid: sec-assignment-operators
|
2014-07-22 01:09:02 +02:00
|
|
|
|
description: Checking by using eval, check operator is x <<= y
|
|
|
|
|
---*/
|
2011-09-07 08:35:18 +02:00
|
|
|
|
|
2014-08-05 17:38:52 +02:00
|
|
|
|
var x;
|
|
|
|
|
|
2011-09-07 08:35:18 +02:00
|
|
|
|
x = 1;
|
2018-10-07 23:31:24 +02:00
|
|
|
|
assert.sameValue(x <<= 1, 2, 'U+0009 (expression)');
|
|
|
|
|
assert.sameValue(x, 2, 'U+0009 (side effect)');
|
2011-09-07 08:35:18 +02:00
|
|
|
|
|
|
|
|
|
x = 1;
|
2018-10-07 23:31:24 +02:00
|
|
|
|
assert.sameValue(x<<=1, 2, 'U+000B (expression)');
|
|
|
|
|
assert.sameValue(x, 2, 'U+000B (side effect)');
|
2011-09-07 08:35:18 +02:00
|
|
|
|
|
|
|
|
|
x = 1;
|
2018-10-07 23:31:24 +02:00
|
|
|
|
assert.sameValue(x<<=1, 2, 'U+000C (expression)');
|
|
|
|
|
assert.sameValue(x, 2, 'U+000C (side effect)');
|
2011-09-07 08:35:18 +02:00
|
|
|
|
|
|
|
|
|
x = 1;
|
2018-10-07 23:31:24 +02:00
|
|
|
|
assert.sameValue(x <<= 1, 2, 'U+0020 (expression)');
|
|
|
|
|
assert.sameValue(x, 2, 'U+0020 (side effect)');
|
2011-09-07 08:35:18 +02:00
|
|
|
|
|
|
|
|
|
x = 1;
|
2018-10-07 23:31:24 +02:00
|
|
|
|
assert.sameValue(x <<= 1, 2, 'U+00A0 (expression)');
|
|
|
|
|
assert.sameValue(x, 2, 'U+00A0 (side effect)');
|
2011-09-07 08:35:18 +02:00
|
|
|
|
|
|
|
|
|
x = 1;
|
2018-10-07 23:31:24 +02:00
|
|
|
|
assert.sameValue(x
|
|
|
|
|
<<=
|
|
|
|
|
1, 2, 'U+000A (expression)');
|
|
|
|
|
assert.sameValue(x, 2, 'U+000A (side effect)');
|
2011-09-07 08:35:18 +02:00
|
|
|
|
|
|
|
|
|
x = 1;
|
2018-10-07 23:31:24 +02:00
|
|
|
|
assert.sameValue(x
<<=
1, 2, 'U+000D (expression)');
|
|
|
|
|
assert.sameValue(x, 2, 'U+000D (side effect)');
|
2011-09-07 08:35:18 +02:00
|
|
|
|
|
|
|
|
|
x = 1;
|
2018-10-07 23:31:24 +02:00
|
|
|
|
assert.sameValue(x
<<=
1, 2, 'U+2028 (expression)');
|
|
|
|
|
assert.sameValue(x, 2, 'U+2028 (side effect)');
|
2011-09-07 08:35:18 +02:00
|
|
|
|
|
|
|
|
|
x = 1;
|
2018-10-07 23:31:24 +02:00
|
|
|
|
assert.sameValue(x
<<=
1, 2, 'U+2029 (expression)');
|
|
|
|
|
assert.sameValue(x, 2, 'U+2029 (side effect)');
|
2011-09-07 08:35:18 +02:00
|
|
|
|
|
|
|
|
|
x = 1;
|
2018-10-07 23:31:24 +02:00
|
|
|
|
assert.sameValue(x
|
|
|
|
|
<<=
|
|
|
|
|
1, 2, 'U+0009U+000BU+000CU+0020U+00A0U+000AU+000DU+2028U+2029 (expression)');
|
|
|
|
|
assert.sameValue(x, 2, 'U+0009U+000BU+000CU+0020U+00A0U+000AU+000DU+2028U+2029 (side effect)');
|