Skip to content
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

[v14.x backport] buffer: introduce Blob #39704

Closed
wants to merge 10 commits into from

Conversation

targos
Copy link
Member

@targos targos commented Aug 8, 2021

  • buffer: introduce Blob
  • test: add wpt tests for Blob
  • util: add internal createDeferredPromise()
  • buffer: add @@toStringTag to Blob
  • buffer: make Blob's slice method more spec-compliant
  • buffer: make Blob's constructor more spec-compliant
  • src: use BaseObject::kInteralFieldCount in Blob
  • buffer: avoid creating the backing store in the thread
  • src: remove more extra semis from member fns
  • test: increase coverage for Blob

@github-actions github-actions bot added lib / src Issues and PRs related to general changes in the lib or src directory. needs-ci PRs that need a full CI run. v14.x labels Aug 8, 2021
@targos
Copy link
Member Author

targos commented Aug 8, 2021

Bundles #36811, #37095, #37336, #37361, #36991, #37052, #38744, and #38515

@targos targos added buffer Issues and PRs related to the buffer subsystem. request-ci Add this label to start a Jenkins CI on a PR. labels Aug 8, 2021
@github-actions github-actions bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Aug 8, 2021
@nodejs-github-bot
Copy link
Collaborator

@targos
Copy link
Member Author

targos commented Aug 8, 2021

Force-pushed to reset author to @jasnell

@targos
Copy link
Member Author

targos commented Aug 12, 2021

I'll land these tomorrow if there are no objections.

jasnell and others added 10 commits August 13, 2021 10:27
The `Blob` object is an immutable data buffer. This is a first step
towards alignment with the `Blob` Web API.

Signed-off-by: James M Snell <[email protected]>

PR-URL: nodejs#36811
Reviewed-By: Antoine du Hamel <[email protected]>
Reviewed-By: Matteo Collina <[email protected]>
Reviewed-By: Benjamin Gruenbaum <[email protected]>
PR-URL: nodejs#36811
Reviewed-By: Antoine du Hamel <[email protected]>
Reviewed-By: Matteo Collina <[email protected]>
Reviewed-By: Benjamin Gruenbaum <[email protected]>
The pattern of resolving/rejecting a Promise from outside of its
executor happens numerous times throughout the codebase (more than
what is updated here in fact). This commit abstracts that logic
into an internal utility function.

PR-URL: nodejs#37095
Reviewed-By: Gus Caplan <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Michaël Zasso <[email protected]>
Reviewed-By: Zijian Liu <[email protected]>
Reviewed-By: James M Snell <[email protected]>
This commit adds the toStringTag to the Blob class to match
the behavior of Chrome and Firefox.

PR-URL: nodejs#37336
Fixes: nodejs#37337
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Antoine du Hamel <[email protected]>
Reviewed-By: James M Snell <[email protected]>
PR-URL: nodejs#37361
Fixes: nodejs#37335
Reviewed-By: Antoine du Hamel <[email protected]>
Reviewed-By: James M Snell <[email protected]>
PR-URL: nodejs#37361
Fixes: nodejs#37352
Fixes: nodejs#37356
Reviewed-By: Antoine du Hamel <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Instead of hard-coding the field count.

PR-URL: nodejs#36991
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Juan José Arboleda <[email protected]>
Fixes: nodejs#37030

PR-URL: nodejs#37052
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: Antoine du Hamel <[email protected]>
Reviewed-By: Rich Trott <[email protected]>
PR-URL: nodejs#38744
Reviewed-By: Richard Lau <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Darshan Sen <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Benjamin Gruenbaum <[email protected]>
targos pushed a commit that referenced this pull request Aug 13, 2021
The `Blob` object is an immutable data buffer. This is a first step
towards alignment with the `Blob` Web API.

Signed-off-by: James M Snell <[email protected]>

PR-URL: #36811
Backport-PR-URL: #39704
Reviewed-By: Antoine du Hamel <[email protected]>
Reviewed-By: Matteo Collina <[email protected]>
Reviewed-By: Benjamin Gruenbaum <[email protected]>
targos added a commit that referenced this pull request Aug 13, 2021
PR-URL: #36811
Backport-PR-URL: #39704
Reviewed-By: Antoine du Hamel <[email protected]>
Reviewed-By: Matteo Collina <[email protected]>
Reviewed-By: Benjamin Gruenbaum <[email protected]>
targos pushed a commit that referenced this pull request Aug 13, 2021
The pattern of resolving/rejecting a Promise from outside of its
executor happens numerous times throughout the codebase (more than
what is updated here in fact). This commit abstracts that logic
into an internal utility function.

PR-URL: #37095
Backport-PR-URL: #39704
Reviewed-By: Gus Caplan <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Michaël Zasso <[email protected]>
Reviewed-By: Zijian Liu <[email protected]>
Reviewed-By: James M Snell <[email protected]>
targos pushed a commit that referenced this pull request Aug 13, 2021
This commit adds the toStringTag to the Blob class to match
the behavior of Chrome and Firefox.

PR-URL: #37336
Backport-PR-URL: #39704
Fixes: #37337
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Antoine du Hamel <[email protected]>
Reviewed-By: James M Snell <[email protected]>
targos added a commit that referenced this pull request Aug 13, 2021
PR-URL: #37361
Backport-PR-URL: #39704
Fixes: #37335
Reviewed-By: Antoine du Hamel <[email protected]>
Reviewed-By: James M Snell <[email protected]>
targos added a commit that referenced this pull request Aug 13, 2021
PR-URL: #37361
Backport-PR-URL: #39704
Fixes: #37352
Fixes: #37356
Reviewed-By: Antoine du Hamel <[email protected]>
Reviewed-By: James M Snell <[email protected]>
targos pushed a commit that referenced this pull request Aug 13, 2021
Instead of hard-coding the field count.

PR-URL: #36991
Backport-PR-URL: #39704
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Juan José Arboleda <[email protected]>
targos pushed a commit that referenced this pull request Aug 13, 2021
Fixes: #37030

PR-URL: #37052
Backport-PR-URL: #39704
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: Antoine du Hamel <[email protected]>
Reviewed-By: Rich Trott <[email protected]>
targos pushed a commit that referenced this pull request Aug 13, 2021
PR-URL: #38744
Backport-PR-URL: #39704
Reviewed-By: Richard Lau <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Darshan Sen <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Benjamin Gruenbaum <[email protected]>
targos pushed a commit that referenced this pull request Aug 13, 2021
Refs: https://coverage.nodejs.org/coverage-68e6673224365120/lib/internal/blob.js.html#L132

PR-URL: #38515
Backport-PR-URL: #39704
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Rich Trott <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Darshan Sen <[email protected]>
@targos
Copy link
Member Author

targos commented Aug 13, 2021

Landed in a343956...f0b7b93

@targos targos closed this Aug 13, 2021
@targos targos deleted the blob-v14 branch August 13, 2021 15:53
MylesBorins pushed a commit that referenced this pull request Aug 31, 2021
The `Blob` object is an immutable data buffer. This is a first step
towards alignment with the `Blob` Web API.

Signed-off-by: James M Snell <[email protected]>

PR-URL: #36811
Backport-PR-URL: #39704
Reviewed-By: Antoine du Hamel <[email protected]>
Reviewed-By: Matteo Collina <[email protected]>
Reviewed-By: Benjamin Gruenbaum <[email protected]>
MylesBorins pushed a commit that referenced this pull request Aug 31, 2021
PR-URL: #36811
Backport-PR-URL: #39704
Reviewed-By: Antoine du Hamel <[email protected]>
Reviewed-By: Matteo Collina <[email protected]>
Reviewed-By: Benjamin Gruenbaum <[email protected]>
MylesBorins pushed a commit that referenced this pull request Aug 31, 2021
The pattern of resolving/rejecting a Promise from outside of its
executor happens numerous times throughout the codebase (more than
what is updated here in fact). This commit abstracts that logic
into an internal utility function.

PR-URL: #37095
Backport-PR-URL: #39704
Reviewed-By: Gus Caplan <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Michaël Zasso <[email protected]>
Reviewed-By: Zijian Liu <[email protected]>
Reviewed-By: James M Snell <[email protected]>
MylesBorins pushed a commit that referenced this pull request Aug 31, 2021
This commit adds the toStringTag to the Blob class to match
the behavior of Chrome and Firefox.

PR-URL: #37336
Backport-PR-URL: #39704
Fixes: #37337
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Antoine du Hamel <[email protected]>
Reviewed-By: James M Snell <[email protected]>
MylesBorins pushed a commit that referenced this pull request Aug 31, 2021
PR-URL: #37361
Backport-PR-URL: #39704
Fixes: #37335
Reviewed-By: Antoine du Hamel <[email protected]>
Reviewed-By: James M Snell <[email protected]>
MylesBorins pushed a commit that referenced this pull request Aug 31, 2021
PR-URL: #37361
Backport-PR-URL: #39704
Fixes: #37352
Fixes: #37356
Reviewed-By: Antoine du Hamel <[email protected]>
Reviewed-By: James M Snell <[email protected]>
MylesBorins pushed a commit that referenced this pull request Aug 31, 2021
Instead of hard-coding the field count.

PR-URL: #36991
Backport-PR-URL: #39704
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Juan José Arboleda <[email protected]>
MylesBorins pushed a commit that referenced this pull request Aug 31, 2021
Fixes: #37030

PR-URL: #37052
Backport-PR-URL: #39704
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: Antoine du Hamel <[email protected]>
Reviewed-By: Rich Trott <[email protected]>
MylesBorins pushed a commit that referenced this pull request Aug 31, 2021
PR-URL: #38744
Backport-PR-URL: #39704
Reviewed-By: Richard Lau <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Darshan Sen <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Benjamin Gruenbaum <[email protected]>
MylesBorins pushed a commit that referenced this pull request Aug 31, 2021
Refs: https://coverage.nodejs.org/coverage-68e6673224365120/lib/internal/blob.js.html#L132

PR-URL: #38515
Backport-PR-URL: #39704
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Rich Trott <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Darshan Sen <[email protected]>
foxxyz pushed a commit to foxxyz/node that referenced this pull request Oct 18, 2021
The `Blob` object is an immutable data buffer. This is a first step
towards alignment with the `Blob` Web API.

Signed-off-by: James M Snell <[email protected]>

PR-URL: nodejs#36811
Backport-PR-URL: nodejs#39704
Reviewed-By: Antoine du Hamel <[email protected]>
Reviewed-By: Matteo Collina <[email protected]>
Reviewed-By: Benjamin Gruenbaum <[email protected]>
foxxyz pushed a commit to foxxyz/node that referenced this pull request Oct 18, 2021
PR-URL: nodejs#36811
Backport-PR-URL: nodejs#39704
Reviewed-By: Antoine du Hamel <[email protected]>
Reviewed-By: Matteo Collina <[email protected]>
Reviewed-By: Benjamin Gruenbaum <[email protected]>
foxxyz pushed a commit to foxxyz/node that referenced this pull request Oct 18, 2021
The pattern of resolving/rejecting a Promise from outside of its
executor happens numerous times throughout the codebase (more than
what is updated here in fact). This commit abstracts that logic
into an internal utility function.

PR-URL: nodejs#37095
Backport-PR-URL: nodejs#39704
Reviewed-By: Gus Caplan <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Michaël Zasso <[email protected]>
Reviewed-By: Zijian Liu <[email protected]>
Reviewed-By: James M Snell <[email protected]>
foxxyz pushed a commit to foxxyz/node that referenced this pull request Oct 18, 2021
This commit adds the toStringTag to the Blob class to match
the behavior of Chrome and Firefox.

PR-URL: nodejs#37336
Backport-PR-URL: nodejs#39704
Fixes: nodejs#37337
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Antoine du Hamel <[email protected]>
Reviewed-By: James M Snell <[email protected]>
foxxyz pushed a commit to foxxyz/node that referenced this pull request Oct 18, 2021
PR-URL: nodejs#37361
Backport-PR-URL: nodejs#39704
Fixes: nodejs#37335
Reviewed-By: Antoine du Hamel <[email protected]>
Reviewed-By: James M Snell <[email protected]>
foxxyz pushed a commit to foxxyz/node that referenced this pull request Oct 18, 2021
PR-URL: nodejs#37361
Backport-PR-URL: nodejs#39704
Fixes: nodejs#37352
Fixes: nodejs#37356
Reviewed-By: Antoine du Hamel <[email protected]>
Reviewed-By: James M Snell <[email protected]>
foxxyz pushed a commit to foxxyz/node that referenced this pull request Oct 18, 2021
Instead of hard-coding the field count.

PR-URL: nodejs#36991
Backport-PR-URL: nodejs#39704
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Juan José Arboleda <[email protected]>
foxxyz pushed a commit to foxxyz/node that referenced this pull request Oct 18, 2021
Fixes: nodejs#37030

PR-URL: nodejs#37052
Backport-PR-URL: nodejs#39704
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: Antoine du Hamel <[email protected]>
Reviewed-By: Rich Trott <[email protected]>
foxxyz pushed a commit to foxxyz/node that referenced this pull request Oct 18, 2021
PR-URL: nodejs#38744
Backport-PR-URL: nodejs#39704
Reviewed-By: Richard Lau <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Darshan Sen <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Benjamin Gruenbaum <[email protected]>
foxxyz pushed a commit to foxxyz/node that referenced this pull request Oct 18, 2021
Refs: https://coverage.nodejs.org/coverage-68e6673224365120/lib/internal/blob.js.html#L132

PR-URL: nodejs#38515
Backport-PR-URL: nodejs#39704
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Rich Trott <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Darshan Sen <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
buffer Issues and PRs related to the buffer subsystem. lib / src Issues and PRs related to general changes in the lib or src directory. needs-ci PRs that need a full CI run.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants