-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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(extras): avoid to check frames in global import #1973
Conversation
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.
Excellent, thank you for the PR. Adding exclusions was always a given on this code path.
it has the same behavior Co-Authored-By: Guy Bedford <guybedford@gmail.com>
Thanks for review ! |
@@ -29,7 +30,8 @@ function noteGlobalProps () { | |||
// but this may be faster (pending benchmarks) | |||
firstGlobalProp = secondGlobalProp = undefined; | |||
for (let p in global) { | |||
if (!global.hasOwnProperty(p)) | |||
// do not check frames cause it could be removed during import | |||
if (!global.hasOwnProperty(p) || (!isNaN(p) && p < global.frames.length)) |
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.
Should we change this one as well?
Sorry for the delayed response - that sounds good to me. Will definitely merge this for the next release then! |
Merged manually in 9da282e. |
Released in 4.1.1. |
Avoid to check frames when comparing properties
eg: routing from a page with iframe to a new page which import global.
Then, the iframe is unmounted during import and "global" value is not the same between noteGlobalProps and getGlobalProp.