diff options
author | Bartek IwaĆczuk <biwanczuk@gmail.com> | 2022-01-27 13:36:36 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-01-27 13:36:36 +0100 |
commit | 884143218fad0e18f7553aaf079d52de703f7601 (patch) | |
tree | 9b9e9d30ea647041438ef8fa974b8d4234cabf73 /runtime/js/40_testing.js | |
parent | dcf8f144ab0516936bfa4e93357d71f1732d880e (diff) |
refactor: update runtime code for primordial checks for "instanceof" (#13497)
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 { |