From 36d22d82aa202bb199967e9512281e9a53db42c9 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 7 Apr 2024 21:33:14 +0200 Subject: Adding upstream version 115.7.0esr. Signed-off-by: Daniel Baumann --- .../language/module-code/instn-star-equality.js | 46 ++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 js/src/tests/test262/language/module-code/instn-star-equality.js (limited to 'js/src/tests/test262/language/module-code/instn-star-equality.js') diff --git a/js/src/tests/test262/language/module-code/instn-star-equality.js b/js/src/tests/test262/language/module-code/instn-star-equality.js new file mode 100644 index 0000000000..55e7182806 --- /dev/null +++ b/js/src/tests/test262/language/module-code/instn-star-equality.js @@ -0,0 +1,46 @@ +// |reftest| module +// Copyright (C) 2016 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +description: A single namespace is created for each module +esid: sec-moduledeclarationinstantiation +info: | + [...] + 12. For each ImportEntry Record in in module.[[ImportEntries]], do + a. Let importedModule be ? HostResolveImportedModule(module, + in.[[ModuleRequest]]). + b. If in.[[ImportName]] is "*", then + i. Let namespace be ? GetModuleNamespace(importedModule). + ii. Perform ! envRec.CreateImmutableBinding(in.[[LocalName]], true). + iii. Call envRec.InitializeBinding(in.[[LocalName]], namespace). + [...] + + 15.2.1.18 Runtime Semantics: GetModuleNamespace + + 1. Assert: module is an instance of a concrete subclass of Module Record. + 2. Let namespace be module.[[Namespace]]. + 3. If namespace is undefined, then + [...] + 4. Return namespace. +flags: [module] +---*/ + +import * as self1 from './instn-star-equality.js'; +import * as self2 from './instn-star-equality.js'; +import * as other1 from './instn-star-equality-other_FIXTURE.js'; +import * as self3 from './instn-star-equality.js'; +import * as other2 from './instn-star-equality-other_FIXTURE.js'; +import { testNs } from './instn-star-equality-other_FIXTURE.js'; + +assert.sameValue( + self1, self2, 'Local namespace objects from consecutive declarations' +); +assert.sameValue( + self1, self3, 'Local namespace objects from non-consective declarations' +); +assert.sameValue(other1, other2, 'External namespace objects'); +assert.sameValue(self1, testNs, 'Re-exported namespace objects'); + +assert.notSameValue(self1, other1); + +reportCompare(0, 0); -- cgit v1.2.3