Update Blob.js#16585
Conversation
|
@facebook-github-bot label Android Generated by 🚫 dangerJS |
|
Okay... but in the specification the first argument is not optional. |
|
@shergin http://jsfiddle.net/thmqwy8t/ |
|
@shergin Can you please accept this PR? |
|
Reading the W3C spec this looks like it has the right behavior: https://w3c.github.io/FileAPI/#constructorBlob. It'd be nice to have a unit test (just for this case), want to add one? |
ide
left a comment
There was a problem hiding this comment.
Style nit + request for simple unit test
| * Reference: https://developer.mozilla.org/en-US/docs/Web/API/Blob/Blob | ||
| */ | ||
| constructor(parts: Array<Blob>, options: any) { | ||
| constructor(parts: Array<Blob>=[], options: any) { |
|
@ide I put spaces , Just tell me where must I create unit test , I don't find correct path |
|
See other examples in this repo -- make tests directories that are colocated with the files under test. |
| blob = false; | ||
| } | ||
|
|
||
| expect(blob).toBe(true); |
There was a problem hiding this comment.
can you write this as expect(() => new Blob()).not.toThrow()?
|
@ide Done |
|
@sm2017 I tried to find reviewers for this pull request and wanted to ping them to take another look. However, based on the blame information for the files in this pull request I couldn't find any reviewers. This sometimes happens when the files in the pull request are new or don't exist on master anymore. Is this pull request still relevant? If yes could you please rebase? In case you know who has context on this code feel free to mention them in a comment (one person is fine). Thanks for reading and hope you will continue contributing to the project. |
|
@facebook-github-bot shipit |
facebook-github-bot
left a comment
There was a problem hiding this comment.
@ide is landing this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
|
I tried to merge this pull request into the Facebook internal repo but some checks failed. To unblock yourself please check the following: Does this pull request pass all open source tests on GitHub? If not please fix those. Does the code still apply cleanly on top of GitHub master? If not can please rebase. In all other cases this means some internal test failed, for example a part of a fb app won't work with this pull request. I've added the Import Failed label to this pull request so it is easy for someone at fb to find the pull request and check what failed. If you don't see anyone comment in a few days feel free to comment mentioning one of the core contributors to the project so they get a notification. |
|
Here's the test that failed: |
|
Seems abandoned. |
Motivation
If you run the following code
The reason is fetch use whatwg-fetch and we have https://github.com/github/fetch/blob/master/fetch.js#L240-L265 and
support.blobis false because https://github.com/github/fetch/blob/master/fetch.js#L16new Blob()throw the following errorI change constructor to
constructor(parts: Array<Blob>=[], options: any)to fix issueTest Plan
N?A
Release Notes
[GENERAL] [BUGFIX] [Blob] - Fix new Blob() issue