From 15ab1bd12f73f494c2f123d7e4f45ee10ca3e86e Mon Sep 17 00:00:00 2001 From: "duncan.macgregor" Date: Wed, 22 Oct 2025 11:28:08 +0100 Subject: [PATCH] Fix and tighten up cross realm `%ThrowTypeError%` test. --- test/built-ins/ThrowTypeError/distinct-cross-realm.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/test/built-ins/ThrowTypeError/distinct-cross-realm.js b/test/built-ins/ThrowTypeError/distinct-cross-realm.js index b256601791..f356ff4383 100644 --- a/test/built-ins/ThrowTypeError/distinct-cross-realm.js +++ b/test/built-ins/ThrowTypeError/distinct-cross-realm.js @@ -17,8 +17,15 @@ var localArgs = function() { "use strict"; return arguments; }(); -var otherArgs = (new other.Function('return arguments;'))(); +var otherArgs = (new other.Function('"use strict"; return arguments;'))(); +var otherArgs2 = (new other.Function('"use strict"; return arguments;'))(); var localThrowTypeError = Object.getOwnPropertyDescriptor(localArgs, "callee").get; var otherThrowTypeError = Object.getOwnPropertyDescriptor(otherArgs, "callee").get; +var otherThrowTypeError2 = Object.getOwnPropertyDescriptor(otherArgs, "callee").get; + +assert.throws(TypeError, function() { + otherThrowTypeError(); +}); assert.notSameValue(localThrowTypeError, otherThrowTypeError); +assert.sameValue(otherThrowTypeError, otherThrowTypeError2);