mirror of
https://github.com/denoland/deno.git
synced 2025-08-03 10:33:54 +00:00
refactor: primordials for instanceof (#13527)
This commit is contained in:
parent
abf89f8c46
commit
8176a4d166
41 changed files with 1030 additions and 660 deletions
|
@ -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 {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue