From f248e6f1778dc26db91d3322de2ecca5d1aa9866 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bartek=20Iwa=C5=84czuk?= Date: Thu, 27 Jan 2022 16:27:22 +0100 Subject: Revert "refactor: update runtime code for primordial checks for "instanceof" (#13497)" (#13511) This reverts commit 884143218fad0e18f7553aaf079d52de703f7601. --- runtime/js/40_testing.js | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'runtime/js/40_testing.js') diff --git a/runtime/js/40_testing.js b/runtime/js/40_testing.js index 62eb1e9a9..5979a523e 100644 --- a/runtime/js/40_testing.js +++ b/runtime/js/40_testing.js @@ -9,15 +9,14 @@ const { serializePermissions } = window.__bootstrap.permissions; const { assert } = window.__bootstrap.util; const { - AggregateErrorPrototype, + AggregateError, ArrayPrototypeFilter, ArrayPrototypePush, ArrayPrototypeShift, ArrayPrototypeSome, DateNow, Error, - FunctionPrototype, - ObjectPrototypeIsPrototypeOf, + Function, Number, ObjectKeys, Promise, @@ -531,7 +530,7 @@ finishing test case.`; } function formatError(error) { - if (ObjectPrototypeIsPrototypeOf(AggregateErrorPrototype, error)) { + if (error instanceof AggregateError) { const message = error .errors .map((error) => @@ -985,7 +984,7 @@ finishing test case.`; /** @returns {TestStepDefinition} */ function getDefinition() { if (typeof nameOrTestDefinition === "string") { - if (!(ObjectPrototypeIsPrototypeOf(FunctionPrototype, fn))) { + if (!(fn instanceof Function)) { throw new TypeError("Expected function for second argument."); } return { -- cgit v1.2.3