This repository was archived by the owner on Apr 12, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 27.4k
fix(copy): add support for copying Blob
objects
#14064
Closed
Closed
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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.
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.
Have you checked if this test perhaps passes and gives a false positive without the applied
copyType()
patch?I seem to recall, when running into this issue first, that the cloned object was getting reported as a
Blob
even though it was not actually one, and I could only detect the difference by attempting to make a call to one of its specific functions likeslice()
or by attempting to read the blob's content by using theFileReader
interface (either of which then failed in some internal implementation, in different ways depending on the browser used).Update: I just checked it at http://plnkr.co/edit/xenwdKodooTrYO7VG2P2 and the test is good while my memory was mistaken. 👍 😄 The test will fail on 3 of those
expect()
calls -size
access,type
access & theisBlob()
check. The thing I recalled incorrectly was that thetypeof
operator was returningBlob
for the cloned object. Good work!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.
BTW, I don't think
typeof
returnsBlob
for blobs. In latest Chrome and Firefox at least, it returnobject
.(Maybe what you had in mind is that
expect(typeof dst).toBe(typeof src)
would indeed pass even without the fix (because both would returnobject
).)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.
I'm certain I got Blob for natively created
Blob
objects with PhantomJS. Don't recall what actual user browsers gave me there. But it does not matter in the end. Should work like a charm now. 😺