This repository was archived by the owner on Feb 26, 2024. It is now read-only.
Zone-binds FileReader#onEventName listeners#174
Closed
matthewjh wants to merge 1 commit intoangular:masterfrom
matthewjh:filereader-playground
Closed
Zone-binds FileReader#onEventName listeners#174matthewjh wants to merge 1 commit intoangular:masterfrom matthewjh:filereader-playground
matthewjh wants to merge 1 commit intoangular:masterfrom
matthewjh:filereader-playground
Conversation
Contributor
Author
|
@vicb can you take a look at this? |
Contributor
There was a problem hiding this comment.
pls change 2 for FileReader.DONE (everywhere this is applicable)
Contributor
There was a problem hiding this comment.
Quick review, not much time this week:
- What if the patch has been applied in
lib/patch/event-target.jsalready ? patchClass('FileReader')willnew FileReader(), is that allowed ?
Contributor
Author
There was a problem hiding this comment.
- What if the patch has been applied in lib/patch/event-target.js already ?
The event target patch patches addEventListener and removeEventListener, which patchClass will wrap in addition to taking care of onXXXX listeners / other function setters that need to be bound. The two patches achieve separate things and the order in which they're applied shouldn't matter.
patchClass('FileReader')willnew FileReader(), is that allowed ?
Yes. There's a guard in patchClass for environments where the class is falsey. I'm not aware of any other scenarios in which you can't new a FileReader.
Contributor
|
LGTM, thanks ! |
Contributor
|
closed via #178 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I took a stab at making the changes to close #137.
No issues as far as I can tell, as
utils.patchClassdoes all the leg work. For some reason though, Android 4.3's native browser'sFileReaderdoesn't haveaddEventListenerorremoveEventListener,so there's a work around for that.