diff options
author | Bartek IwaĆczuk <biwanczuk@gmail.com> | 2022-02-01 18:06:11 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-02-01 18:06:11 +0100 |
commit | 8176a4d1663529fb8aeebf7734c4994fa1d583f4 (patch) | |
tree | 94c7d6eb2679e641f59cf78640340f5b7af0022e /runtime/js/40_testing.js | |
parent | abf89f8c4675ed78c992fafd6d758bf4bfca8a1a (diff) |
refactor: primordials for instanceof (#13527)
Diffstat (limited to 'runtime/js/40_testing.js')
-rw-r--r-- | runtime/js/40_testing.js | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/runtime/js/40_testing.js b/runtime/js/40_testing.js index 5979a523e..62eb1e9a9 100644 --- a/runtime/js/40_testing.js +++ b/runtime/js/40_testing.js @@ -9,14 +9,15 @@ const { serializePermissions } = window.__bootstrap.permissions; const { assert } = window.__bootstrap.util; const { - AggregateError, + AggregateErrorPrototype, ArrayPrototypeFilter, ArrayPrototypePush, ArrayPrototypeShift, ArrayPrototypeSome, DateNow, Error, - Function, + FunctionPrototype, + ObjectPrototypeIsPrototypeOf, Number, ObjectKeys, Promise, @@ -530,7 +531,7 @@ finishing test case.`; } function formatError(error) { - if (error instanceof AggregateError) { + if (ObjectPrototypeIsPrototypeOf(AggregateErrorPrototype, error)) { const message = error .errors .map((error) => @@ -984,7 +985,7 @@ finishing test case.`; /** @returns {TestStepDefinition} */ function getDefinition() { if (typeof nameOrTestDefinition === "string") { - if (!(fn instanceof Function)) { + if (!(ObjectPrototypeIsPrototypeOf(FunctionPrototype, fn))) { throw new TypeError("Expected function for second argument."); } return { |