-
Notifications
You must be signed in to change notification settings - Fork 134
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: patch to angular detection in rrweb #1566
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
+ try { | ||
+ if (!isFunction(x)) { | ||
+ return false; | ||
+ } | ||
+ const prototypeKeys = Object.getOwnPropertyNames(x.prototype || {}); | ||
+ return prototypeKeys.some((key) => key.indexOf('__zone')); | ||
+ } catch { | ||
+ // we've seen some intermittent problems in Safari since introducing this check | ||
+ return false |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is the new thing, so let's wrap it and return false
very speculative
- if (!untaintedObject) return defaultPrototype; | ||
+ if (!untaintedObject) return defaultObj.prototype; | ||
return untaintedBasePrototype$1[key] = untaintedObject; | ||
} catch { | ||
- return defaultPrototype; | ||
+ return defaultObj.prototype; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we return slightly different things on different lines
we didn't change this but it's nicer to always return the same thing
NB in a site where I could reproduce the problem it was if (!untaintedObject) return defaultPrototype;
that was returning
Size Change: +357 B (+0.01%) Total Size: 3.17 MB
ℹ️ View Unchanged
|
It's really hard to reproduce the bug, and in the one site where I can reproduce it it's really hard to debug what's happening.
Explanation in-line in the review, but this is an attempt to make this detection safer in Safari