From e2719e1dbf7b706cd5ec8b3ecd899d2fc063c20f Mon Sep 17 00:00:00 2001 From: janekptacijarabaci Date: Sat, 14 Apr 2018 08:51:05 +0200 Subject: Bug 1326453 - Part 3: Don't throw a TypeError when SetPrototypeOf for module namespace objects is called with null --- js/src/jit-test/tests/modules/import-namespace.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'js/src/jit-test/tests') diff --git a/js/src/jit-test/tests/modules/import-namespace.js b/js/src/jit-test/tests/modules/import-namespace.js index 71a1ce7df..27d0193aa 100644 --- a/js/src/jit-test/tests/modules/import-namespace.js +++ b/js/src/jit-test/tests/modules/import-namespace.js @@ -39,7 +39,9 @@ assertEq(getModuleEnvironmentValue(b, "x"), 3); // Test module namespace internal methods as defined in 9.4.6 assertEq(Object.getPrototypeOf(ns), null); -assertThrowsInstanceOf(() => Object.setPrototypeOf(ns, null), TypeError); +assertEq(Reflect.setPrototypeOf(ns, null), true); +assertEq(Reflect.setPrototypeOf(ns, Object.prototype), false); +assertThrowsInstanceOf(() => Object.setPrototypeOf(ns, {}), TypeError); assertThrowsInstanceOf(function() { ns.foo = 1; }, TypeError); assertEq(Object.isExtensible(ns), false); Object.preventExtensions(ns); -- cgit v1.2.3