Skip to content

Commit

Permalink
fix: Not in the browser
Browse files Browse the repository at this point in the history
  • Loading branch information
jinc.cjc committed Dec 5, 2019
1 parent a6ce0cd commit 676ff5f
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions packages/shared/src/compare.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,15 @@ function equal(a: any, b: any, filter?: Filter) {
if (regexpA && regexpB) {
return a.toString() === b.toString()
}
const urlA = a instanceof URL
const urlB = b instanceof URL
if (urlA && urlB) {
return a.href === b.href
// fix: Not in the browser
if(typeof URL !== void(0)){
const urlA = a instanceof URL
const urlB = b instanceof URL
if (urlA && urlB) {
return a.href === b.href
}
}

const keys = keyList(a)
length = keys.length

Expand Down

1 comment on commit 676ff5f

@jincdream
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

在worker环境下运行会报错

Please sign in to comment.