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

Commits on Aug 13, 2021

  1. buffer: introduce Blob

    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 <jasnell@gmail.com>
    
    PR-URL: nodejs#36811
    Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
    Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
    Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
    jasnell authored and targos committed Aug 13, 2021
    Configuration menu
    Copy the full SHA
    deb8512 View commit details
    Browse the repository at this point in the history
  2. test: add wpt tests for Blob

    PR-URL: nodejs#36811
    Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
    Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
    Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
    targos committed Aug 13, 2021
    Configuration menu
    Copy the full SHA
    bdff82f View commit details
    Browse the repository at this point in the history
  3. util: add internal createDeferredPromise()

    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 <me@gus.host>
    Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
    Reviewed-By: Michaël Zasso <targos@protonmail.com>
    Reviewed-By: Zijian Liu <lxxyxzj@gmail.com>
    Reviewed-By: James M Snell <jasnell@gmail.com>
    cjihrig authored and targos committed Aug 13, 2021
    Configuration menu
    Copy the full SHA
    71ccdf3 View commit details
    Browse the repository at this point in the history
  4. buffer: add @@toStringTag to Blob

    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 <luigipinca@gmail.com>
    Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
    Reviewed-By: James M Snell <jasnell@gmail.com>
    cjihrig authored and targos committed Aug 13, 2021
    Configuration menu
    Copy the full SHA
    bb0c918 View commit details
    Browse the repository at this point in the history
  5. buffer: make Blob's slice method more spec-compliant

    PR-URL: nodejs#37361
    Fixes: nodejs#37335
    Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
    Reviewed-By: James M Snell <jasnell@gmail.com>
    targos committed Aug 13, 2021
    Configuration menu
    Copy the full SHA
    2ad19c1 View commit details
    Browse the repository at this point in the history
  6. buffer: make Blob's constructor more spec-compliant

    PR-URL: nodejs#37361
    Fixes: nodejs#37352
    Fixes: nodejs#37356
    Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
    Reviewed-By: James M Snell <jasnell@gmail.com>
    targos committed Aug 13, 2021
    Configuration menu
    Copy the full SHA
    60a4de6 View commit details
    Browse the repository at this point in the history
  7. src: use BaseObject::kInteralFieldCount in Blob

    Instead of hard-coding the field count.
    
    PR-URL: nodejs#36991
    Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
    Reviewed-By: James M Snell <jasnell@gmail.com>
    Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com>
    joyeecheung authored and targos committed Aug 13, 2021
    Configuration menu
    Copy the full SHA
    2dd9467 View commit details
    Browse the repository at this point in the history
  8. buffer: avoid creating the backing store in the thread

    Fixes: nodejs#37030
    
    PR-URL: nodejs#37052
    Reviewed-By: Anna Henningsen <anna@addaleax.net>
    Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
    Reviewed-By: Rich Trott <rtrott@gmail.com>
    jasnell authored and targos committed Aug 13, 2021
    Configuration menu
    Copy the full SHA
    add1067 View commit details
    Browse the repository at this point in the history
  9. src: remove more extra semis from member fns

    PR-URL: nodejs#38744
    Reviewed-By: Richard Lau <rlau@redhat.com>
    Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
    Reviewed-By: Darshan Sen <raisinten@gmail.com>
    Reviewed-By: James M Snell <jasnell@gmail.com>
    Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
    codebytere authored and targos committed Aug 13, 2021
    Configuration menu
    Copy the full SHA
    5eaf696 View commit details
    Browse the repository at this point in the history
  10. test: increase coverage for Blob

    Refs: https://coverage.nodejs.org/coverage-68e6673224365120/lib/internal/blob.js.html#L132
    
    PR-URL: nodejs#38515
    Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
    Reviewed-By: Rich Trott <rtrott@gmail.com>
    Reviewed-By: James M Snell <jasnell@gmail.com>
    Reviewed-By: Darshan Sen <raisinten@gmail.com>
    Lxxyx authored and targos committed Aug 13, 2021
    Configuration menu
    Copy the full SHA
    9a9f207 View commit details
    Browse the repository at this point in the history