Skip to content
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#174
matthewjh wants to merge 1 commit intoangular:masterfrom
matthewjh:filereader-playground

Conversation

@matthewjh
Copy link
Copy Markdown
Contributor

I took a stab at making the changes to close #137.

No issues as far as I can tell, as utils.patchClass does all the leg work. For some reason though, Android 4.3's native browser's FileReader doesn't have addEventListener or removeEventListener, so there's a work around for that.

@matthewjh
Copy link
Copy Markdown
Contributor Author

@vicb can you take a look at this?

Comment thread test/patch/FileReader.spec.js Outdated
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

pls change 2 for FileReader.DONE (everywhere this is applicable)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done

Comment thread lib/patch/file-reader.js
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Quick review, not much time this week:

  • What if the patch has been applied in lib/patch/event-target.js already ?
  • patchClass('FileReader') will new FileReader(), is that allowed ?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

  • 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') will new 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.

@vicb
Copy link
Copy Markdown
Contributor

vicb commented Sep 11, 2015

LGTM, thanks !

@vicb
Copy link
Copy Markdown
Contributor

vicb commented Sep 11, 2015

closed via #178

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

FileReader events aren't zoned

2 participants