From 5a725fe1223b11856658759801554b60f2aa7cf1 Mon Sep 17 00:00:00 2001 From: Aleksey Shvayka Date: Wed, 15 May 2019 21:29:11 +0300 Subject: [PATCH] Expect TypeError from correct realm --- .../apply/argarray-not-object-realm.js | 12 ++++++------ .../apply/this-not-callable-realm.js | 19 ++++++++++--------- 2 files changed, 16 insertions(+), 15 deletions(-) diff --git a/test/built-ins/Function/prototype/apply/argarray-not-object-realm.js b/test/built-ins/Function/prototype/apply/argarray-not-object-realm.js index 3a9fb8db23..9e24578eee 100644 --- a/test/built-ins/Function/prototype/apply/argarray-not-object-realm.js +++ b/test/built-ins/Function/prototype/apply/argarray-not-object-realm.js @@ -18,21 +18,21 @@ info: | features: [cross-realm] ---*/ -var OFunction = $262.createRealm().global.Function; -var fn = new OFunction(); +var other = $262.createRealm().global; +var fn = new other.Function(); -assert.throws(TypeError, function() { +assert.throws(other.TypeError, function() { fn.apply(null, false); }); -assert.throws(TypeError, function() { +assert.throws(other.TypeError, function() { fn.apply(null, 1234.5678); }); -assert.throws(TypeError, function() { +assert.throws(other.TypeError, function() { fn.apply(null, ''); }); -assert.throws(TypeError, function() { +assert.throws(other.TypeError, function() { fn.apply(null, Symbol('desc')); }); diff --git a/test/built-ins/Function/prototype/apply/this-not-callable-realm.js b/test/built-ins/Function/prototype/apply/this-not-callable-realm.js index 373aa329d4..0d951bce24 100644 --- a/test/built-ins/Function/prototype/apply/this-not-callable-realm.js +++ b/test/built-ins/Function/prototype/apply/this-not-callable-realm.js @@ -13,20 +13,21 @@ info: | features: [cross-realm] ---*/ -var OFunction = $262.createRealm().global.Function; +var other = $262.createRealm().global; +var otherApply = other.Function.prototype.apply; -assert.throws(TypeError, function() { - OFunction.prototype.apply.call(undefined, {}, []); +assert.throws(other.TypeError, function() { + otherApply.call(undefined, {}, []); }); -assert.throws(TypeError, function() { - OFunction.prototype.apply.call(null, {}, []); +assert.throws(other.TypeError, function() { + otherApply.call(null, {}, []); }); -assert.throws(TypeError, function() { - OFunction.prototype.apply.call({}, {}, []); +assert.throws(other.TypeError, function() { + otherApply.call({}, {}, []); }); -assert.throws(TypeError, function() { - OFunction.prototype.apply.call(/re/, {}, []); +assert.throws(other.TypeError, function() { + otherApply.call(/re/, {}, []); });