diff --git a/test/language/expressions/assignment/S11.13.1_A7_T1.js b/test/language/expressions/assignment/S11.13.1_A7_T1.js new file mode 100755 index 0000000000000000000000000000000000000000..74a655ead548f56982416e7f978dcf68f9b4fb14 --- /dev/null +++ b/test/language/expressions/assignment/S11.13.1_A7_T1.js @@ -0,0 +1,38 @@ +// Copyright (C) 2015 André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +info: Assignment Operator evaluates its operands from left to right. +description: > + The left-hand side expression is evaluated before the right-hand side. + Left-hand side expression is MemberExpression: base[prop]. base is the + null value. +---*/ + +function DummyError() { } + +assert.throws(DummyError, function() { + var base = null; + var prop = function() { + throw new DummyError(); + }; + var expr = function() { + $ERROR("right-hand side expression evaluated"); + }; + + base[prop()] = expr(); +}); + +assert.throws(TypeError, function() { + var base = null; + var prop = { + toString: function() { + $ERROR("property key evaluated"); + } + }; + var expr = function() { + $ERROR("right-hand side expression evaluated"); + }; + + base[prop] = expr(); +}); diff --git a/test/language/expressions/assignment/S11.13.1_A7_T2.js b/test/language/expressions/assignment/S11.13.1_A7_T2.js new file mode 100755 index 0000000000000000000000000000000000000000..173f3e6b08b34a2ba465d073ba48c5ad533638bd --- /dev/null +++ b/test/language/expressions/assignment/S11.13.1_A7_T2.js @@ -0,0 +1,38 @@ +// Copyright (C) 2015 André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +info: Assignment Operator evaluates its operands from left to right. +description: > + The left-hand side expression is evaluated before the right-hand side. + Left-hand side expression is MemberExpression: base[prop]. base is the + undefined value. +---*/ + +function DummyError() { } + +assert.throws(DummyError, function() { + var base = undefined; + var prop = function() { + throw new DummyError(); + }; + var expr = function() { + $ERROR("right-hand side expression evaluated"); + }; + + base[prop()] = expr(); +}); + +assert.throws(TypeError, function() { + var base = undefined; + var prop = { + toString: function() { + $ERROR("property key evaluated"); + } + }; + var expr = function() { + $ERROR("right-hand side expression evaluated"); + }; + + base[prop] = expr(); +}); diff --git a/test/language/expressions/assignment/S11.13.1_A7_T3.js b/test/language/expressions/assignment/S11.13.1_A7_T3.js new file mode 100755 index 0000000000000000000000000000000000000000..5bbc35d603ac401d3a2c44cb7a99ecdf760db4e5 --- /dev/null +++ b/test/language/expressions/assignment/S11.13.1_A7_T3.js @@ -0,0 +1,26 @@ +// Copyright (C) 2015 André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +info: Assignment Operator evaluates its operands from left to right. +description: > + The left-hand side expression is evaluated before the right-hand side. + Left-hand side expression is MemberExpression: base[prop]. Evaluating + ToPropertyKey(prop) throws an error. +---*/ + +function DummyError() { } + +assert.throws(DummyError, function() { + var base = {}; + var prop = { + toString: function() { + throw new DummyError(); + } + }; + var expr = function() { + $ERROR("right-hand side expression evaluated"); + }; + + base[prop] = expr(); +}); diff --git a/test/language/expressions/assignment/S11.13.1_A7_T4.js b/test/language/expressions/assignment/S11.13.1_A7_T4.js new file mode 100755 index 0000000000000000000000000000000000000000..33111b0b9d993e0f05266b0401ef24ef223d3a55 --- /dev/null +++ b/test/language/expressions/assignment/S11.13.1_A7_T4.js @@ -0,0 +1,25 @@ +// Copyright (C) 2015 André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +info: Assignment Operator evaluates its operands from left to right. +description: > + The left-hand side expression is evaluated before the right-hand side. + Left-hand side expression is MemberExpression: base[prop]. ToPropertyKey(prop) + is only called once. +---*/ + +var propKeyEvaluated = false; +var base = {}; +var prop = { + toString: function() { + assert(!propKeyEvaluated); + propKeyEvaluated = true; + return ""; + } +}; +var expr = function() { + return 0; +}; + +base[prop] = expr(); diff --git a/test/language/expressions/compound-assignment/S11.13.2_A7.10_T1.js b/test/language/expressions/compound-assignment/S11.13.2_A7.10_T1.js new file mode 100755 index 0000000000000000000000000000000000000000..13fdc3563c03153e0a5271f662139fdb9207440c --- /dev/null +++ b/test/language/expressions/compound-assignment/S11.13.2_A7.10_T1.js @@ -0,0 +1,39 @@ +// Copyright (C) 2015 André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +info: Compound Assignment Operator evaluates its operands from left to right. +description: > + The left-hand side expression is evaluated before the right-hand side. + Left-hand side expression is MemberExpression: base[prop]. base is the + null value. + Check operator is "x ^= y". +---*/ + +function DummyError() { } + +assert.throws(DummyError, function() { + var base = null; + var prop = function() { + throw new DummyError(); + }; + var expr = function() { + $ERROR("right-hand side expression evaluated"); + }; + + base[prop()] ^= expr(); +}); + +assert.throws(TypeError, function() { + var base = null; + var prop = { + toString: function() { + $ERROR("property key evaluated"); + } + }; + var expr = function() { + $ERROR("right-hand side expression evaluated"); + }; + + base[prop] ^= expr(); +}); diff --git a/test/language/expressions/compound-assignment/S11.13.2_A7.10_T2.js b/test/language/expressions/compound-assignment/S11.13.2_A7.10_T2.js new file mode 100755 index 0000000000000000000000000000000000000000..cb0da6b8894e36fb6954d8bbced6ccaec72f050c --- /dev/null +++ b/test/language/expressions/compound-assignment/S11.13.2_A7.10_T2.js @@ -0,0 +1,39 @@ +// Copyright (C) 2015 André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +info: Compound Assignment Operator evaluates its operands from left to right. +description: > + The left-hand side expression is evaluated before the right-hand side. + Left-hand side expression is MemberExpression: base[prop]. base is the + undefined value. + Check operator is "x ^= y". +---*/ + +function DummyError() { } + +assert.throws(DummyError, function() { + var base = undefined; + var prop = function() { + throw new DummyError(); + }; + var expr = function() { + $ERROR("right-hand side expression evaluated"); + }; + + base[prop()] ^= expr(); +}); + +assert.throws(TypeError, function() { + var base = undefined; + var prop = { + toString: function() { + $ERROR("property key evaluated"); + } + }; + var expr = function() { + $ERROR("right-hand side expression evaluated"); + }; + + base[prop] ^= expr(); +}); diff --git a/test/language/expressions/compound-assignment/S11.13.2_A7.10_T3.js b/test/language/expressions/compound-assignment/S11.13.2_A7.10_T3.js new file mode 100755 index 0000000000000000000000000000000000000000..ff238d1d7dec42ba9dcdcc31dc1fbc7db96cb21a --- /dev/null +++ b/test/language/expressions/compound-assignment/S11.13.2_A7.10_T3.js @@ -0,0 +1,27 @@ +// Copyright (C) 2015 André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +info: Compound Assignment Operator evaluates its operands from left to right. +description: > + The left-hand side expression is evaluated before the right-hand side. + Left-hand side expression is MemberExpression: base[prop]. Evaluating + ToPropertyKey(prop) throws an error. + Check operator is "x ^= y". +---*/ + +function DummyError() { } + +assert.throws(DummyError, function() { + var base = {}; + var prop = { + toString: function() { + throw new DummyError(); + } + }; + var expr = function() { + $ERROR("right-hand side expression evaluated"); + }; + + base[prop] ^= expr(); +}); diff --git a/test/language/expressions/compound-assignment/S11.13.2_A7.10_T4.js b/test/language/expressions/compound-assignment/S11.13.2_A7.10_T4.js new file mode 100755 index 0000000000000000000000000000000000000000..4aadbb01a43e0de3fa3e593994ff344f096ba8f8 --- /dev/null +++ b/test/language/expressions/compound-assignment/S11.13.2_A7.10_T4.js @@ -0,0 +1,26 @@ +// Copyright (C) 2015 André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +info: Compound Assignment Operator evaluates its operands from left to right. +description: > + The left-hand side expression is evaluated before the right-hand side. + Left-hand side expression is MemberExpression: base[prop]. ToPropertyKey(prop) + is only called once. + Check operator is "x ^= y". +---*/ + +var propKeyEvaluated = false; +var base = {}; +var prop = { + toString: function() { + assert(!propKeyEvaluated); + propKeyEvaluated = true; + return ""; + } +}; +var expr = function() { + return 0; +}; + +base[prop] ^= expr(); diff --git a/test/language/expressions/compound-assignment/S11.13.2_A7.11_T1.js b/test/language/expressions/compound-assignment/S11.13.2_A7.11_T1.js new file mode 100755 index 0000000000000000000000000000000000000000..c90e4b3be9af8674db31c101b43b21bec8ab61d8 --- /dev/null +++ b/test/language/expressions/compound-assignment/S11.13.2_A7.11_T1.js @@ -0,0 +1,39 @@ +// Copyright (C) 2015 André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +info: Compound Assignment Operator evaluates its operands from left to right. +description: > + The left-hand side expression is evaluated before the right-hand side. + Left-hand side expression is MemberExpression: base[prop]. base is the + null value. + Check operator is "x |= y". +---*/ + +function DummyError() { } + +assert.throws(DummyError, function() { + var base = null; + var prop = function() { + throw new DummyError(); + }; + var expr = function() { + $ERROR("right-hand side expression evaluated"); + }; + + base[prop()] |= expr(); +}); + +assert.throws(TypeError, function() { + var base = null; + var prop = { + toString: function() { + $ERROR("property key evaluated"); + } + }; + var expr = function() { + $ERROR("right-hand side expression evaluated"); + }; + + base[prop] |= expr(); +}); diff --git a/test/language/expressions/compound-assignment/S11.13.2_A7.11_T2.js b/test/language/expressions/compound-assignment/S11.13.2_A7.11_T2.js new file mode 100755 index 0000000000000000000000000000000000000000..54b6ac33cc39b8b0d148ad52829c833fa152e5d6 --- /dev/null +++ b/test/language/expressions/compound-assignment/S11.13.2_A7.11_T2.js @@ -0,0 +1,39 @@ +// Copyright (C) 2015 André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +info: Compound Assignment Operator evaluates its operands from left to right. +description: > + The left-hand side expression is evaluated before the right-hand side. + Left-hand side expression is MemberExpression: base[prop]. base is the + undefined value. + Check operator is "x |= y". +---*/ + +function DummyError() { } + +assert.throws(DummyError, function() { + var base = undefined; + var prop = function() { + throw new DummyError(); + }; + var expr = function() { + $ERROR("right-hand side expression evaluated"); + }; + + base[prop()] |= expr(); +}); + +assert.throws(TypeError, function() { + var base = undefined; + var prop = { + toString: function() { + $ERROR("property key evaluated"); + } + }; + var expr = function() { + $ERROR("right-hand side expression evaluated"); + }; + + base[prop] |= expr(); +}); diff --git a/test/language/expressions/compound-assignment/S11.13.2_A7.11_T3.js b/test/language/expressions/compound-assignment/S11.13.2_A7.11_T3.js new file mode 100755 index 0000000000000000000000000000000000000000..98d6714bd3c5edbafb8c915ccb82a8ef4b2b5b71 --- /dev/null +++ b/test/language/expressions/compound-assignment/S11.13.2_A7.11_T3.js @@ -0,0 +1,27 @@ +// Copyright (C) 2015 André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +info: Compound Assignment Operator evaluates its operands from left to right. +description: > + The left-hand side expression is evaluated before the right-hand side. + Left-hand side expression is MemberExpression: base[prop]. Evaluating + ToPropertyKey(prop) throws an error. + Check operator is "x |= y". +---*/ + +function DummyError() { } + +assert.throws(DummyError, function() { + var base = {}; + var prop = { + toString: function() { + throw new DummyError(); + } + }; + var expr = function() { + $ERROR("right-hand side expression evaluated"); + }; + + base[prop] |= expr(); +}); diff --git a/test/language/expressions/compound-assignment/S11.13.2_A7.11_T4.js b/test/language/expressions/compound-assignment/S11.13.2_A7.11_T4.js new file mode 100755 index 0000000000000000000000000000000000000000..310f3ba9bdbde992976dc7b3da5bad47ab24cf33 --- /dev/null +++ b/test/language/expressions/compound-assignment/S11.13.2_A7.11_T4.js @@ -0,0 +1,26 @@ +// Copyright (C) 2015 André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +info: Compound Assignment Operator evaluates its operands from left to right. +description: > + The left-hand side expression is evaluated before the right-hand side. + Left-hand side expression is MemberExpression: base[prop]. ToPropertyKey(prop) + is only called once. + Check operator is "x |= y". +---*/ + +var propKeyEvaluated = false; +var base = {}; +var prop = { + toString: function() { + assert(!propKeyEvaluated); + propKeyEvaluated = true; + return ""; + } +}; +var expr = function() { + return 0; +}; + +base[prop] |= expr(); diff --git a/test/language/expressions/compound-assignment/S11.13.2_A7.1_T1.js b/test/language/expressions/compound-assignment/S11.13.2_A7.1_T1.js new file mode 100755 index 0000000000000000000000000000000000000000..ef60588bcbe7906473479fe79dc376dff8a924fe --- /dev/null +++ b/test/language/expressions/compound-assignment/S11.13.2_A7.1_T1.js @@ -0,0 +1,39 @@ +// Copyright (C) 2015 André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +info: Compound Assignment Operator evaluates its operands from left to right. +description: > + The left-hand side expression is evaluated before the right-hand side. + Left-hand side expression is MemberExpression: base[prop]. base is the + null value. + Check operator is "x *= y". +---*/ + +function DummyError() { } + +assert.throws(DummyError, function() { + var base = null; + var prop = function() { + throw new DummyError(); + }; + var expr = function() { + $ERROR("right-hand side expression evaluated"); + }; + + base[prop()] *= expr(); +}); + +assert.throws(TypeError, function() { + var base = null; + var prop = { + toString: function() { + $ERROR("property key evaluated"); + } + }; + var expr = function() { + $ERROR("right-hand side expression evaluated"); + }; + + base[prop] *= expr(); +}); diff --git a/test/language/expressions/compound-assignment/S11.13.2_A7.1_T2.js b/test/language/expressions/compound-assignment/S11.13.2_A7.1_T2.js new file mode 100755 index 0000000000000000000000000000000000000000..5d679b239fec5b9e94ef926f8ce2337ef862de7c --- /dev/null +++ b/test/language/expressions/compound-assignment/S11.13.2_A7.1_T2.js @@ -0,0 +1,39 @@ +// Copyright (C) 2015 André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +info: Compound Assignment Operator evaluates its operands from left to right. +description: > + The left-hand side expression is evaluated before the right-hand side. + Left-hand side expression is MemberExpression: base[prop]. base is the + undefined value. + Check operator is "x *= y". +---*/ + +function DummyError() { } + +assert.throws(DummyError, function() { + var base = undefined; + var prop = function() { + throw new DummyError(); + }; + var expr = function() { + $ERROR("right-hand side expression evaluated"); + }; + + base[prop()] *= expr(); +}); + +assert.throws(TypeError, function() { + var base = undefined; + var prop = { + toString: function() { + $ERROR("property key evaluated"); + } + }; + var expr = function() { + $ERROR("right-hand side expression evaluated"); + }; + + base[prop] *= expr(); +}); diff --git a/test/language/expressions/compound-assignment/S11.13.2_A7.1_T3.js b/test/language/expressions/compound-assignment/S11.13.2_A7.1_T3.js new file mode 100755 index 0000000000000000000000000000000000000000..3d8082f1d9d4007444791934a87146bb9fdaf576 --- /dev/null +++ b/test/language/expressions/compound-assignment/S11.13.2_A7.1_T3.js @@ -0,0 +1,27 @@ +// Copyright (C) 2015 André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +info: Compound Assignment Operator evaluates its operands from left to right. +description: > + The left-hand side expression is evaluated before the right-hand side. + Left-hand side expression is MemberExpression: base[prop]. Evaluating + ToPropertyKey(prop) throws an error. + Check operator is "x *= y". +---*/ + +function DummyError() { } + +assert.throws(DummyError, function() { + var base = {}; + var prop = { + toString: function() { + throw new DummyError(); + } + }; + var expr = function() { + $ERROR("right-hand side expression evaluated"); + }; + + base[prop] *= expr(); +}); diff --git a/test/language/expressions/compound-assignment/S11.13.2_A7.1_T4.js b/test/language/expressions/compound-assignment/S11.13.2_A7.1_T4.js new file mode 100755 index 0000000000000000000000000000000000000000..3f49ca96e0e77fdf1fb6c255191b30e61cd7a3eb --- /dev/null +++ b/test/language/expressions/compound-assignment/S11.13.2_A7.1_T4.js @@ -0,0 +1,26 @@ +// Copyright (C) 2015 André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +info: Compound Assignment Operator evaluates its operands from left to right. +description: > + The left-hand side expression is evaluated before the right-hand side. + Left-hand side expression is MemberExpression: base[prop]. ToPropertyKey(prop) + is only called once. + Check operator is "x *= y". +---*/ + +var propKeyEvaluated = false; +var base = {}; +var prop = { + toString: function() { + assert(!propKeyEvaluated); + propKeyEvaluated = true; + return ""; + } +}; +var expr = function() { + return 0; +}; + +base[prop] *= expr(); diff --git a/test/language/expressions/compound-assignment/S11.13.2_A7.2_T1.js b/test/language/expressions/compound-assignment/S11.13.2_A7.2_T1.js new file mode 100755 index 0000000000000000000000000000000000000000..bdef8f389b8f81be05ee19f9f53559b4596bcb0f --- /dev/null +++ b/test/language/expressions/compound-assignment/S11.13.2_A7.2_T1.js @@ -0,0 +1,39 @@ +// Copyright (C) 2015 André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +info: Compound Assignment Operator evaluates its operands from left to right. +description: > + The left-hand side expression is evaluated before the right-hand side. + Left-hand side expression is MemberExpression: base[prop]. base is the + null value. + Check operator is "x /= y". +---*/ + +function DummyError() { } + +assert.throws(DummyError, function() { + var base = null; + var prop = function() { + throw new DummyError(); + }; + var expr = function() { + $ERROR("right-hand side expression evaluated"); + }; + + base[prop()] /= expr(); +}); + +assert.throws(TypeError, function() { + var base = null; + var prop = { + toString: function() { + $ERROR("property key evaluated"); + } + }; + var expr = function() { + $ERROR("right-hand side expression evaluated"); + }; + + base[prop] /= expr(); +}); diff --git a/test/language/expressions/compound-assignment/S11.13.2_A7.2_T2.js b/test/language/expressions/compound-assignment/S11.13.2_A7.2_T2.js new file mode 100755 index 0000000000000000000000000000000000000000..66bf3c36980a4c11908db732e5afebeba36545c5 --- /dev/null +++ b/test/language/expressions/compound-assignment/S11.13.2_A7.2_T2.js @@ -0,0 +1,39 @@ +// Copyright (C) 2015 André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +info: Compound Assignment Operator evaluates its operands from left to right. +description: > + The left-hand side expression is evaluated before the right-hand side. + Left-hand side expression is MemberExpression: base[prop]. base is the + undefined value. + Check operator is "x /= y". +---*/ + +function DummyError() { } + +assert.throws(DummyError, function() { + var base = undefined; + var prop = function() { + throw new DummyError(); + }; + var expr = function() { + $ERROR("right-hand side expression evaluated"); + }; + + base[prop()] /= expr(); +}); + +assert.throws(TypeError, function() { + var base = undefined; + var prop = { + toString: function() { + $ERROR("property key evaluated"); + } + }; + var expr = function() { + $ERROR("right-hand side expression evaluated"); + }; + + base[prop] /= expr(); +}); diff --git a/test/language/expressions/compound-assignment/S11.13.2_A7.2_T3.js b/test/language/expressions/compound-assignment/S11.13.2_A7.2_T3.js new file mode 100755 index 0000000000000000000000000000000000000000..f1b12354be9032140103373a81e01e908e962b5e --- /dev/null +++ b/test/language/expressions/compound-assignment/S11.13.2_A7.2_T3.js @@ -0,0 +1,27 @@ +// Copyright (C) 2015 André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +info: Compound Assignment Operator evaluates its operands from left to right. +description: > + The left-hand side expression is evaluated before the right-hand side. + Left-hand side expression is MemberExpression: base[prop]. Evaluating + ToPropertyKey(prop) throws an error. + Check operator is "x /= y". +---*/ + +function DummyError() { } + +assert.throws(DummyError, function() { + var base = {}; + var prop = { + toString: function() { + throw new DummyError(); + } + }; + var expr = function() { + $ERROR("right-hand side expression evaluated"); + }; + + base[prop] /= expr(); +}); diff --git a/test/language/expressions/compound-assignment/S11.13.2_A7.2_T4.js b/test/language/expressions/compound-assignment/S11.13.2_A7.2_T4.js new file mode 100755 index 0000000000000000000000000000000000000000..c7963d97ea700eaa11dec81b83c5288550f57e5a --- /dev/null +++ b/test/language/expressions/compound-assignment/S11.13.2_A7.2_T4.js @@ -0,0 +1,26 @@ +// Copyright (C) 2015 André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +info: Compound Assignment Operator evaluates its operands from left to right. +description: > + The left-hand side expression is evaluated before the right-hand side. + Left-hand side expression is MemberExpression: base[prop]. ToPropertyKey(prop) + is only called once. + Check operator is "x /= y". +---*/ + +var propKeyEvaluated = false; +var base = {}; +var prop = { + toString: function() { + assert(!propKeyEvaluated); + propKeyEvaluated = true; + return ""; + } +}; +var expr = function() { + return 0; +}; + +base[prop] /= expr(); diff --git a/test/language/expressions/compound-assignment/S11.13.2_A7.3_T1.js b/test/language/expressions/compound-assignment/S11.13.2_A7.3_T1.js new file mode 100755 index 0000000000000000000000000000000000000000..bd5856afd1f792178c51b5f489077e5f7bbc37fe --- /dev/null +++ b/test/language/expressions/compound-assignment/S11.13.2_A7.3_T1.js @@ -0,0 +1,39 @@ +// Copyright (C) 2015 André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +info: Compound Assignment Operator evaluates its operands from left to right. +description: > + The left-hand side expression is evaluated before the right-hand side. + Left-hand side expression is MemberExpression: base[prop]. base is the + null value. + Check operator is "x %= y". +---*/ + +function DummyError() { } + +assert.throws(DummyError, function() { + var base = null; + var prop = function() { + throw new DummyError(); + }; + var expr = function() { + $ERROR("right-hand side expression evaluated"); + }; + + base[prop()] %= expr(); +}); + +assert.throws(TypeError, function() { + var base = null; + var prop = { + toString: function() { + $ERROR("property key evaluated"); + } + }; + var expr = function() { + $ERROR("right-hand side expression evaluated"); + }; + + base[prop] %= expr(); +}); diff --git a/test/language/expressions/compound-assignment/S11.13.2_A7.3_T2.js b/test/language/expressions/compound-assignment/S11.13.2_A7.3_T2.js new file mode 100755 index 0000000000000000000000000000000000000000..0361333a2ffd10e719f883f176cfb351f5b2556d --- /dev/null +++ b/test/language/expressions/compound-assignment/S11.13.2_A7.3_T2.js @@ -0,0 +1,39 @@ +// Copyright (C) 2015 André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +info: Compound Assignment Operator evaluates its operands from left to right. +description: > + The left-hand side expression is evaluated before the right-hand side. + Left-hand side expression is MemberExpression: base[prop]. base is the + undefined value. + Check operator is "x %= y". +---*/ + +function DummyError() { } + +assert.throws(DummyError, function() { + var base = undefined; + var prop = function() { + throw new DummyError(); + }; + var expr = function() { + $ERROR("right-hand side expression evaluated"); + }; + + base[prop()] %= expr(); +}); + +assert.throws(TypeError, function() { + var base = undefined; + var prop = { + toString: function() { + $ERROR("property key evaluated"); + } + }; + var expr = function() { + $ERROR("right-hand side expression evaluated"); + }; + + base[prop] %= expr(); +}); diff --git a/test/language/expressions/compound-assignment/S11.13.2_A7.3_T3.js b/test/language/expressions/compound-assignment/S11.13.2_A7.3_T3.js new file mode 100755 index 0000000000000000000000000000000000000000..ab16d1c9282a472b1da2a5b27337a7ff9c2e9c32 --- /dev/null +++ b/test/language/expressions/compound-assignment/S11.13.2_A7.3_T3.js @@ -0,0 +1,27 @@ +// Copyright (C) 2015 André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +info: Compound Assignment Operator evaluates its operands from left to right. +description: > + The left-hand side expression is evaluated before the right-hand side. + Left-hand side expression is MemberExpression: base[prop]. Evaluating + ToPropertyKey(prop) throws an error. + Check operator is "x %= y". +---*/ + +function DummyError() { } + +assert.throws(DummyError, function() { + var base = {}; + var prop = { + toString: function() { + throw new DummyError(); + } + }; + var expr = function() { + $ERROR("right-hand side expression evaluated"); + }; + + base[prop] %= expr(); +}); diff --git a/test/language/expressions/compound-assignment/S11.13.2_A7.3_T4.js b/test/language/expressions/compound-assignment/S11.13.2_A7.3_T4.js new file mode 100755 index 0000000000000000000000000000000000000000..c7f0f541714b6209ca977c01340cc2d267116a79 --- /dev/null +++ b/test/language/expressions/compound-assignment/S11.13.2_A7.3_T4.js @@ -0,0 +1,26 @@ +// Copyright (C) 2015 André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +info: Compound Assignment Operator evaluates its operands from left to right. +description: > + The left-hand side expression is evaluated before the right-hand side. + Left-hand side expression is MemberExpression: base[prop]. ToPropertyKey(prop) + is only called once. + Check operator is "x %= y". +---*/ + +var propKeyEvaluated = false; +var base = {}; +var prop = { + toString: function() { + assert(!propKeyEvaluated); + propKeyEvaluated = true; + return ""; + } +}; +var expr = function() { + return 0; +}; + +base[prop] %= expr(); diff --git a/test/language/expressions/compound-assignment/S11.13.2_A7.4_T1.js b/test/language/expressions/compound-assignment/S11.13.2_A7.4_T1.js new file mode 100755 index 0000000000000000000000000000000000000000..164c2202e4ceb56fa4441483e6c072b64f9823ce --- /dev/null +++ b/test/language/expressions/compound-assignment/S11.13.2_A7.4_T1.js @@ -0,0 +1,39 @@ +// Copyright (C) 2015 André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +info: Compound Assignment Operator evaluates its operands from left to right. +description: > + The left-hand side expression is evaluated before the right-hand side. + Left-hand side expression is MemberExpression: base[prop]. base is the + null value. + Check operator is "x += y". +---*/ + +function DummyError() { } + +assert.throws(DummyError, function() { + var base = null; + var prop = function() { + throw new DummyError(); + }; + var expr = function() { + $ERROR("right-hand side expression evaluated"); + }; + + base[prop()] += expr(); +}); + +assert.throws(TypeError, function() { + var base = null; + var prop = { + toString: function() { + $ERROR("property key evaluated"); + } + }; + var expr = function() { + $ERROR("right-hand side expression evaluated"); + }; + + base[prop] += expr(); +}); diff --git a/test/language/expressions/compound-assignment/S11.13.2_A7.4_T2.js b/test/language/expressions/compound-assignment/S11.13.2_A7.4_T2.js new file mode 100755 index 0000000000000000000000000000000000000000..f3391e7688e4f37c3a1d200db1c449c4499b76cb --- /dev/null +++ b/test/language/expressions/compound-assignment/S11.13.2_A7.4_T2.js @@ -0,0 +1,39 @@ +// Copyright (C) 2015 André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +info: Compound Assignment Operator evaluates its operands from left to right. +description: > + The left-hand side expression is evaluated before the right-hand side. + Left-hand side expression is MemberExpression: base[prop]. base is the + undefined value. + Check operator is "x += y". +---*/ + +function DummyError() { } + +assert.throws(DummyError, function() { + var base = undefined; + var prop = function() { + throw new DummyError(); + }; + var expr = function() { + $ERROR("right-hand side expression evaluated"); + }; + + base[prop()] += expr(); +}); + +assert.throws(TypeError, function() { + var base = undefined; + var prop = { + toString: function() { + $ERROR("property key evaluated"); + } + }; + var expr = function() { + $ERROR("right-hand side expression evaluated"); + }; + + base[prop] += expr(); +}); diff --git a/test/language/expressions/compound-assignment/S11.13.2_A7.4_T3.js b/test/language/expressions/compound-assignment/S11.13.2_A7.4_T3.js new file mode 100755 index 0000000000000000000000000000000000000000..4580299c138e0ec79ccd7f475c4b7048d96fd79e --- /dev/null +++ b/test/language/expressions/compound-assignment/S11.13.2_A7.4_T3.js @@ -0,0 +1,27 @@ +// Copyright (C) 2015 André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +info: Compound Assignment Operator evaluates its operands from left to right. +description: > + The left-hand side expression is evaluated before the right-hand side. + Left-hand side expression is MemberExpression: base[prop]. Evaluating + ToPropertyKey(prop) throws an error. + Check operator is "x += y". +---*/ + +function DummyError() { } + +assert.throws(DummyError, function() { + var base = {}; + var prop = { + toString: function() { + throw new DummyError(); + } + }; + var expr = function() { + $ERROR("right-hand side expression evaluated"); + }; + + base[prop] += expr(); +}); diff --git a/test/language/expressions/compound-assignment/S11.13.2_A7.4_T4.js b/test/language/expressions/compound-assignment/S11.13.2_A7.4_T4.js new file mode 100755 index 0000000000000000000000000000000000000000..b149e25281d7c385ea70576d576bef652d23f652 --- /dev/null +++ b/test/language/expressions/compound-assignment/S11.13.2_A7.4_T4.js @@ -0,0 +1,26 @@ +// Copyright (C) 2015 André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +info: Compound Assignment Operator evaluates its operands from left to right. +description: > + The left-hand side expression is evaluated before the right-hand side. + Left-hand side expression is MemberExpression: base[prop]. ToPropertyKey(prop) + is only called once. + Check operator is "x += y". +---*/ + +var propKeyEvaluated = false; +var base = {}; +var prop = { + toString: function() { + assert(!propKeyEvaluated); + propKeyEvaluated = true; + return ""; + } +}; +var expr = function() { + return 0; +}; + +base[prop] += expr(); diff --git a/test/language/expressions/compound-assignment/S11.13.2_A7.5_T1.js b/test/language/expressions/compound-assignment/S11.13.2_A7.5_T1.js new file mode 100755 index 0000000000000000000000000000000000000000..654dcfa67ac49c45f67b6efd0fcdb0debf5f532b --- /dev/null +++ b/test/language/expressions/compound-assignment/S11.13.2_A7.5_T1.js @@ -0,0 +1,39 @@ +// Copyright (C) 2015 André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +info: Compound Assignment Operator evaluates its operands from left to right. +description: > + The left-hand side expression is evaluated before the right-hand side. + Left-hand side expression is MemberExpression: base[prop]. base is the + null value. + Check operator is "x -= y". +---*/ + +function DummyError() { } + +assert.throws(DummyError, function() { + var base = null; + var prop = function() { + throw new DummyError(); + }; + var expr = function() { + $ERROR("right-hand side expression evaluated"); + }; + + base[prop()] -= expr(); +}); + +assert.throws(TypeError, function() { + var base = null; + var prop = { + toString: function() { + $ERROR("property key evaluated"); + } + }; + var expr = function() { + $ERROR("right-hand side expression evaluated"); + }; + + base[prop] -= expr(); +}); diff --git a/test/language/expressions/compound-assignment/S11.13.2_A7.5_T2.js b/test/language/expressions/compound-assignment/S11.13.2_A7.5_T2.js new file mode 100755 index 0000000000000000000000000000000000000000..bfb79e0dc28760e3b5e1e9896be4915fa317f8dd --- /dev/null +++ b/test/language/expressions/compound-assignment/S11.13.2_A7.5_T2.js @@ -0,0 +1,39 @@ +// Copyright (C) 2015 André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +info: Compound Assignment Operator evaluates its operands from left to right. +description: > + The left-hand side expression is evaluated before the right-hand side. + Left-hand side expression is MemberExpression: base[prop]. base is the + undefined value. + Check operator is "x -= y". +---*/ + +function DummyError() { } + +assert.throws(DummyError, function() { + var base = undefined; + var prop = function() { + throw new DummyError(); + }; + var expr = function() { + $ERROR("right-hand side expression evaluated"); + }; + + base[prop()] -= expr(); +}); + +assert.throws(TypeError, function() { + var base = undefined; + var prop = { + toString: function() { + $ERROR("property key evaluated"); + } + }; + var expr = function() { + $ERROR("right-hand side expression evaluated"); + }; + + base[prop] -= expr(); +}); diff --git a/test/language/expressions/compound-assignment/S11.13.2_A7.5_T3.js b/test/language/expressions/compound-assignment/S11.13.2_A7.5_T3.js new file mode 100755 index 0000000000000000000000000000000000000000..a4df835b2fb08e19d9dd88e6384699fe7847ccbe --- /dev/null +++ b/test/language/expressions/compound-assignment/S11.13.2_A7.5_T3.js @@ -0,0 +1,27 @@ +// Copyright (C) 2015 André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +info: Compound Assignment Operator evaluates its operands from left to right. +description: > + The left-hand side expression is evaluated before the right-hand side. + Left-hand side expression is MemberExpression: base[prop]. Evaluating + ToPropertyKey(prop) throws an error. + Check operator is "x -= y". +---*/ + +function DummyError() { } + +assert.throws(DummyError, function() { + var base = {}; + var prop = { + toString: function() { + throw new DummyError(); + } + }; + var expr = function() { + $ERROR("right-hand side expression evaluated"); + }; + + base[prop] -= expr(); +}); diff --git a/test/language/expressions/compound-assignment/S11.13.2_A7.5_T4.js b/test/language/expressions/compound-assignment/S11.13.2_A7.5_T4.js new file mode 100755 index 0000000000000000000000000000000000000000..dd0515e5d2a9326e70f068d454fbe172d02e29e7 --- /dev/null +++ b/test/language/expressions/compound-assignment/S11.13.2_A7.5_T4.js @@ -0,0 +1,26 @@ +// Copyright (C) 2015 André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +info: Compound Assignment Operator evaluates its operands from left to right. +description: > + The left-hand side expression is evaluated before the right-hand side. + Left-hand side expression is MemberExpression: base[prop]. ToPropertyKey(prop) + is only called once. + Check operator is "x -= y". +---*/ + +var propKeyEvaluated = false; +var base = {}; +var prop = { + toString: function() { + assert(!propKeyEvaluated); + propKeyEvaluated = true; + return ""; + } +}; +var expr = function() { + return 0; +}; + +base[prop] -= expr(); diff --git a/test/language/expressions/compound-assignment/S11.13.2_A7.6_T1.js b/test/language/expressions/compound-assignment/S11.13.2_A7.6_T1.js new file mode 100755 index 0000000000000000000000000000000000000000..e0213c0c3a68638ccf21cb6106d0bb3fd7bd00dd --- /dev/null +++ b/test/language/expressions/compound-assignment/S11.13.2_A7.6_T1.js @@ -0,0 +1,39 @@ +// Copyright (C) 2015 André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +info: Compound Assignment Operator evaluates its operands from left to right. +description: > + The left-hand side expression is evaluated before the right-hand side. + Left-hand side expression is MemberExpression: base[prop]. base is the + null value. + Check operator is "x <<= y". +---*/ + +function DummyError() { } + +assert.throws(DummyError, function() { + var base = null; + var prop = function() { + throw new DummyError(); + }; + var expr = function() { + $ERROR("right-hand side expression evaluated"); + }; + + base[prop()] <<= expr(); +}); + +assert.throws(TypeError, function() { + var base = null; + var prop = { + toString: function() { + $ERROR("property key evaluated"); + } + }; + var expr = function() { + $ERROR("right-hand side expression evaluated"); + }; + + base[prop] <<= expr(); +}); diff --git a/test/language/expressions/compound-assignment/S11.13.2_A7.6_T2.js b/test/language/expressions/compound-assignment/S11.13.2_A7.6_T2.js new file mode 100755 index 0000000000000000000000000000000000000000..73efcb61fa11bfe503140afa784f7acfd88563d2 --- /dev/null +++ b/test/language/expressions/compound-assignment/S11.13.2_A7.6_T2.js @@ -0,0 +1,39 @@ +// Copyright (C) 2015 André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +info: Compound Assignment Operator evaluates its operands from left to right. +description: > + The left-hand side expression is evaluated before the right-hand side. + Left-hand side expression is MemberExpression: base[prop]. base is the + undefined value. + Check operator is "x <<= y". +---*/ + +function DummyError() { } + +assert.throws(DummyError, function() { + var base = undefined; + var prop = function() { + throw new DummyError(); + }; + var expr = function() { + $ERROR("right-hand side expression evaluated"); + }; + + base[prop()] <<= expr(); +}); + +assert.throws(TypeError, function() { + var base = undefined; + var prop = { + toString: function() { + $ERROR("property key evaluated"); + } + }; + var expr = function() { + $ERROR("right-hand side expression evaluated"); + }; + + base[prop] <<= expr(); +}); diff --git a/test/language/expressions/compound-assignment/S11.13.2_A7.6_T3.js b/test/language/expressions/compound-assignment/S11.13.2_A7.6_T3.js new file mode 100755 index 0000000000000000000000000000000000000000..d57eb8296fb20be55cd93a8c3505089498f13ed4 --- /dev/null +++ b/test/language/expressions/compound-assignment/S11.13.2_A7.6_T3.js @@ -0,0 +1,27 @@ +// Copyright (C) 2015 André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +info: Compound Assignment Operator evaluates its operands from left to right. +description: > + The left-hand side expression is evaluated before the right-hand side. + Left-hand side expression is MemberExpression: base[prop]. Evaluating + ToPropertyKey(prop) throws an error. + Check operator is "x <<= y". +---*/ + +function DummyError() { } + +assert.throws(DummyError, function() { + var base = {}; + var prop = { + toString: function() { + throw new DummyError(); + } + }; + var expr = function() { + $ERROR("right-hand side expression evaluated"); + }; + + base[prop] <<= expr(); +}); diff --git a/test/language/expressions/compound-assignment/S11.13.2_A7.6_T4.js b/test/language/expressions/compound-assignment/S11.13.2_A7.6_T4.js new file mode 100755 index 0000000000000000000000000000000000000000..df88da9e3177d522523f1977bf7c7da95b499bd0 --- /dev/null +++ b/test/language/expressions/compound-assignment/S11.13.2_A7.6_T4.js @@ -0,0 +1,26 @@ +// Copyright (C) 2015 André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +info: Compound Assignment Operator evaluates its operands from left to right. +description: > + The left-hand side expression is evaluated before the right-hand side. + Left-hand side expression is MemberExpression: base[prop]. ToPropertyKey(prop) + is only called once. + Check operator is "x <<= y". +---*/ + +var propKeyEvaluated = false; +var base = {}; +var prop = { + toString: function() { + assert(!propKeyEvaluated); + propKeyEvaluated = true; + return ""; + } +}; +var expr = function() { + return 0; +}; + +base[prop] <<= expr(); diff --git a/test/language/expressions/compound-assignment/S11.13.2_A7.7_T1.js b/test/language/expressions/compound-assignment/S11.13.2_A7.7_T1.js new file mode 100755 index 0000000000000000000000000000000000000000..03c494c4968bbe49c862755f6f38daacacecd584 --- /dev/null +++ b/test/language/expressions/compound-assignment/S11.13.2_A7.7_T1.js @@ -0,0 +1,39 @@ +// Copyright (C) 2015 André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +info: Compound Assignment Operator evaluates its operands from left to right. +description: > + The left-hand side expression is evaluated before the right-hand side. + Left-hand side expression is MemberExpression: base[prop]. base is the + null value. + Check operator is "x >>= y". +---*/ + +function DummyError() { } + +assert.throws(DummyError, function() { + var base = null; + var prop = function() { + throw new DummyError(); + }; + var expr = function() { + $ERROR("right-hand side expression evaluated"); + }; + + base[prop()] >>= expr(); +}); + +assert.throws(TypeError, function() { + var base = null; + var prop = { + toString: function() { + $ERROR("property key evaluated"); + } + }; + var expr = function() { + $ERROR("right-hand side expression evaluated"); + }; + + base[prop] >>= expr(); +}); diff --git a/test/language/expressions/compound-assignment/S11.13.2_A7.7_T2.js b/test/language/expressions/compound-assignment/S11.13.2_A7.7_T2.js new file mode 100755 index 0000000000000000000000000000000000000000..94e2e39a320d6c712d5d9730ad359f782cc7c375 --- /dev/null +++ b/test/language/expressions/compound-assignment/S11.13.2_A7.7_T2.js @@ -0,0 +1,39 @@ +// Copyright (C) 2015 André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +info: Compound Assignment Operator evaluates its operands from left to right. +description: > + The left-hand side expression is evaluated before the right-hand side. + Left-hand side expression is MemberExpression: base[prop]. base is the + undefined value. + Check operator is "x >>= y". +---*/ + +function DummyError() { } + +assert.throws(DummyError, function() { + var base = undefined; + var prop = function() { + throw new DummyError(); + }; + var expr = function() { + $ERROR("right-hand side expression evaluated"); + }; + + base[prop()] >>= expr(); +}); + +assert.throws(TypeError, function() { + var base = undefined; + var prop = { + toString: function() { + $ERROR("property key evaluated"); + } + }; + var expr = function() { + $ERROR("right-hand side expression evaluated"); + }; + + base[prop] >>= expr(); +}); diff --git a/test/language/expressions/compound-assignment/S11.13.2_A7.7_T3.js b/test/language/expressions/compound-assignment/S11.13.2_A7.7_T3.js new file mode 100755 index 0000000000000000000000000000000000000000..b60a358ff326bc9e5b29480fa9b43cadf115e37a --- /dev/null +++ b/test/language/expressions/compound-assignment/S11.13.2_A7.7_T3.js @@ -0,0 +1,27 @@ +// Copyright (C) 2015 André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +info: Compound Assignment Operator evaluates its operands from left to right. +description: > + The left-hand side expression is evaluated before the right-hand side. + Left-hand side expression is MemberExpression: base[prop]. Evaluating + ToPropertyKey(prop) throws an error. + Check operator is "x >>= y". +---*/ + +function DummyError() { } + +assert.throws(DummyError, function() { + var base = {}; + var prop = { + toString: function() { + throw new DummyError(); + } + }; + var expr = function() { + $ERROR("right-hand side expression evaluated"); + }; + + base[prop] >>= expr(); +}); diff --git a/test/language/expressions/compound-assignment/S11.13.2_A7.7_T4.js b/test/language/expressions/compound-assignment/S11.13.2_A7.7_T4.js new file mode 100755 index 0000000000000000000000000000000000000000..43d18298bdfe52c656929e1dfab0a0b55f5669f7 --- /dev/null +++ b/test/language/expressions/compound-assignment/S11.13.2_A7.7_T4.js @@ -0,0 +1,26 @@ +// Copyright (C) 2015 André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +info: Compound Assignment Operator evaluates its operands from left to right. +description: > + The left-hand side expression is evaluated before the right-hand side. + Left-hand side expression is MemberExpression: base[prop]. ToPropertyKey(prop) + is only called once. + Check operator is "x >>= y". +---*/ + +var propKeyEvaluated = false; +var base = {}; +var prop = { + toString: function() { + assert(!propKeyEvaluated); + propKeyEvaluated = true; + return ""; + } +}; +var expr = function() { + return 0; +}; + +base[prop] >>= expr(); diff --git a/test/language/expressions/compound-assignment/S11.13.2_A7.8_T1.js b/test/language/expressions/compound-assignment/S11.13.2_A7.8_T1.js new file mode 100755 index 0000000000000000000000000000000000000000..4c4d65ad63fd6cb3ebf299ef304444c92fc71906 --- /dev/null +++ b/test/language/expressions/compound-assignment/S11.13.2_A7.8_T1.js @@ -0,0 +1,39 @@ +// Copyright (C) 2015 André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +info: Compound Assignment Operator evaluates its operands from left to right. +description: > + The left-hand side expression is evaluated before the right-hand side. + Left-hand side expression is MemberExpression: base[prop]. base is the + null value. + Check operator is "x >>>= y". +---*/ + +function DummyError() { } + +assert.throws(DummyError, function() { + var base = null; + var prop = function() { + throw new DummyError(); + }; + var expr = function() { + $ERROR("right-hand side expression evaluated"); + }; + + base[prop()] >>>= expr(); +}); + +assert.throws(TypeError, function() { + var base = null; + var prop = { + toString: function() { + $ERROR("property key evaluated"); + } + }; + var expr = function() { + $ERROR("right-hand side expression evaluated"); + }; + + base[prop] >>>= expr(); +}); diff --git a/test/language/expressions/compound-assignment/S11.13.2_A7.8_T2.js b/test/language/expressions/compound-assignment/S11.13.2_A7.8_T2.js new file mode 100755 index 0000000000000000000000000000000000000000..c3fcfa10286ba79116419a35a4798cbc2392a7d1 --- /dev/null +++ b/test/language/expressions/compound-assignment/S11.13.2_A7.8_T2.js @@ -0,0 +1,39 @@ +// Copyright (C) 2015 André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +info: Compound Assignment Operator evaluates its operands from left to right. +description: > + The left-hand side expression is evaluated before the right-hand side. + Left-hand side expression is MemberExpression: base[prop]. base is the + undefined value. + Check operator is "x >>>= y". +---*/ + +function DummyError() { } + +assert.throws(DummyError, function() { + var base = undefined; + var prop = function() { + throw new DummyError(); + }; + var expr = function() { + $ERROR("right-hand side expression evaluated"); + }; + + base[prop()] >>>= expr(); +}); + +assert.throws(TypeError, function() { + var base = undefined; + var prop = { + toString: function() { + $ERROR("property key evaluated"); + } + }; + var expr = function() { + $ERROR("right-hand side expression evaluated"); + }; + + base[prop] >>>= expr(); +}); diff --git a/test/language/expressions/compound-assignment/S11.13.2_A7.8_T3.js b/test/language/expressions/compound-assignment/S11.13.2_A7.8_T3.js new file mode 100755 index 0000000000000000000000000000000000000000..7a50332651a1f32037dc4eb6ae629f41058ff11d --- /dev/null +++ b/test/language/expressions/compound-assignment/S11.13.2_A7.8_T3.js @@ -0,0 +1,27 @@ +// Copyright (C) 2015 André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +info: Compound Assignment Operator evaluates its operands from left to right. +description: > + The left-hand side expression is evaluated before the right-hand side. + Left-hand side expression is MemberExpression: base[prop]. Evaluating + ToPropertyKey(prop) throws an error. + Check operator is "x >>>= y". +---*/ + +function DummyError() { } + +assert.throws(DummyError, function() { + var base = {}; + var prop = { + toString: function() { + throw new DummyError(); + } + }; + var expr = function() { + $ERROR("right-hand side expression evaluated"); + }; + + base[prop] >>>= expr(); +}); diff --git a/test/language/expressions/compound-assignment/S11.13.2_A7.8_T4.js b/test/language/expressions/compound-assignment/S11.13.2_A7.8_T4.js new file mode 100755 index 0000000000000000000000000000000000000000..844282d17c3e2a480c8f2c93361b06f509f1ea4f --- /dev/null +++ b/test/language/expressions/compound-assignment/S11.13.2_A7.8_T4.js @@ -0,0 +1,26 @@ +// Copyright (C) 2015 André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +info: Compound Assignment Operator evaluates its operands from left to right. +description: > + The left-hand side expression is evaluated before the right-hand side. + Left-hand side expression is MemberExpression: base[prop]. ToPropertyKey(prop) + is only called once. + Check operator is "x >>>= y". +---*/ + +var propKeyEvaluated = false; +var base = {}; +var prop = { + toString: function() { + assert(!propKeyEvaluated); + propKeyEvaluated = true; + return ""; + } +}; +var expr = function() { + return 0; +}; + +base[prop] >>>= expr(); diff --git a/test/language/expressions/compound-assignment/S11.13.2_A7.9_T1.js b/test/language/expressions/compound-assignment/S11.13.2_A7.9_T1.js new file mode 100755 index 0000000000000000000000000000000000000000..7f69c9d344b888578721cd441427b8f007a9c615 --- /dev/null +++ b/test/language/expressions/compound-assignment/S11.13.2_A7.9_T1.js @@ -0,0 +1,39 @@ +// Copyright (C) 2015 André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +info: Compound Assignment Operator evaluates its operands from left to right. +description: > + The left-hand side expression is evaluated before the right-hand side. + Left-hand side expression is MemberExpression: base[prop]. base is the + null value. + Check operator is "x &= y". +---*/ + +function DummyError() { } + +assert.throws(DummyError, function() { + var base = null; + var prop = function() { + throw new DummyError(); + }; + var expr = function() { + $ERROR("right-hand side expression evaluated"); + }; + + base[prop()] &= expr(); +}); + +assert.throws(TypeError, function() { + var base = null; + var prop = { + toString: function() { + $ERROR("property key evaluated"); + } + }; + var expr = function() { + $ERROR("right-hand side expression evaluated"); + }; + + base[prop] &= expr(); +}); diff --git a/test/language/expressions/compound-assignment/S11.13.2_A7.9_T2.js b/test/language/expressions/compound-assignment/S11.13.2_A7.9_T2.js new file mode 100755 index 0000000000000000000000000000000000000000..d149d5bb10b94654905dedc25f40e2d0b8ab5ddf --- /dev/null +++ b/test/language/expressions/compound-assignment/S11.13.2_A7.9_T2.js @@ -0,0 +1,39 @@ +// Copyright (C) 2015 André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +info: Compound Assignment Operator evaluates its operands from left to right. +description: > + The left-hand side expression is evaluated before the right-hand side. + Left-hand side expression is MemberExpression: base[prop]. base is the + undefined value. + Check operator is "x &= y". +---*/ + +function DummyError() { } + +assert.throws(DummyError, function() { + var base = undefined; + var prop = function() { + throw new DummyError(); + }; + var expr = function() { + $ERROR("right-hand side expression evaluated"); + }; + + base[prop()] &= expr(); +}); + +assert.throws(TypeError, function() { + var base = undefined; + var prop = { + toString: function() { + $ERROR("property key evaluated"); + } + }; + var expr = function() { + $ERROR("right-hand side expression evaluated"); + }; + + base[prop] &= expr(); +}); diff --git a/test/language/expressions/compound-assignment/S11.13.2_A7.9_T3.js b/test/language/expressions/compound-assignment/S11.13.2_A7.9_T3.js new file mode 100755 index 0000000000000000000000000000000000000000..da724914e617de94798771f40c2aa6bfd159a343 --- /dev/null +++ b/test/language/expressions/compound-assignment/S11.13.2_A7.9_T3.js @@ -0,0 +1,27 @@ +// Copyright (C) 2015 André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +info: Compound Assignment Operator evaluates its operands from left to right. +description: > + The left-hand side expression is evaluated before the right-hand side. + Left-hand side expression is MemberExpression: base[prop]. Evaluating + ToPropertyKey(prop) throws an error. + Check operator is "x &= y". +---*/ + +function DummyError() { } + +assert.throws(DummyError, function() { + var base = {}; + var prop = { + toString: function() { + throw new DummyError(); + } + }; + var expr = function() { + $ERROR("right-hand side expression evaluated"); + }; + + base[prop] &= expr(); +}); diff --git a/test/language/expressions/compound-assignment/S11.13.2_A7.9_T4.js b/test/language/expressions/compound-assignment/S11.13.2_A7.9_T4.js new file mode 100755 index 0000000000000000000000000000000000000000..709f65a5f617e1445cec5129e76dce8eeb5791dd --- /dev/null +++ b/test/language/expressions/compound-assignment/S11.13.2_A7.9_T4.js @@ -0,0 +1,26 @@ +// Copyright (C) 2015 André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +info: Compound Assignment Operator evaluates its operands from left to right. +description: > + The left-hand side expression is evaluated before the right-hand side. + Left-hand side expression is MemberExpression: base[prop]. ToPropertyKey(prop) + is only called once. + Check operator is "x &= y". +---*/ + +var propKeyEvaluated = false; +var base = {}; +var prop = { + toString: function() { + assert(!propKeyEvaluated); + propKeyEvaluated = true; + return ""; + } +}; +var expr = function() { + return 0; +}; + +base[prop] &= expr();