From 3936950114fcdf49ece33bbbc52b71ac4ebbb32c Mon Sep 17 00:00:00 2001 From: Leo Balter Date: Fri, 19 Oct 2018 12:33:55 -0400 Subject: [PATCH] Fix test previously invalid for strict mode --- .../lhs-eq-assign-expr-nostrict.js | 36 +++++++++++++++++++ .../assign-expr/lhs-eq-assign-expr.js | 1 - 2 files changed, 36 insertions(+), 1 deletion(-) create mode 100644 test/language/expressions/dynamic-import/assign-expr/lhs-eq-assign-expr-nostrict.js diff --git a/test/language/expressions/dynamic-import/assign-expr/lhs-eq-assign-expr-nostrict.js b/test/language/expressions/dynamic-import/assign-expr/lhs-eq-assign-expr-nostrict.js new file mode 100644 index 0000000000..ed95de271e --- /dev/null +++ b/test/language/expressions/dynamic-import/assign-expr/lhs-eq-assign-expr-nostrict.js @@ -0,0 +1,36 @@ +// Copyright (C) 2018 Leo Balter. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +description: > + Dynamic Import receives an AssignmentExpression (LHS Expr = AssignmentExpression) + Using a frozen object property +esid: prod-ImportCall +info: | + ImportCall [Yield]: + import ( AssignmentExpression[+In, ?Yield] ) + + AssignmentExpression[In, Yield, Await]: + ConditionalExpression[?In, ?Yield, ?Await] + [+Yield]YieldExpression[?In, ?Await] + ArrowFunction[?In, ?Yield, ?Await] + AsyncArrowFunction[?In, ?Yield, ?Await] + LeftHandSideExpression[?Yield, ?Await] = AssignmentExpression[?In, ?Yield, ?Await] + LeftHandSideExpression[?Yield, ?Await] AssignmentOperator AssignmentExpression[?In, ?Yield, ?Await] +flags: [async, noStrict] +features: [dynamic-import] +---*/ + +const y = { + z: 0 +}; +Object.freeze(y); +const b = './module-code-other_FIXTURE.js'; + +async function fn() { + const ns2 = await import(y.z = b); // import('./module-code-other_FIXTURE.js') + + assert.sameValue(ns2.local1, 'one six one two'); + assert.sameValue(ns2.default, 1612); +} + +fn().then($DONE, $DONE).catch($DONE); diff --git a/test/language/expressions/dynamic-import/assign-expr/lhs-eq-assign-expr.js b/test/language/expressions/dynamic-import/assign-expr/lhs-eq-assign-expr.js index e84d42db1d..1c86637ecc 100644 --- a/test/language/expressions/dynamic-import/assign-expr/lhs-eq-assign-expr.js +++ b/test/language/expressions/dynamic-import/assign-expr/lhs-eq-assign-expr.js @@ -23,7 +23,6 @@ let x = 'foo'; const y = { z: 0 }; -Object.freeze(y); const a = './module-code_FIXTURE.js'; const b = './module-code-other_FIXTURE.js';