Commit Graph

5 Commits

Author SHA1 Message Date
Michaël Zasso
458a4108b7
buffer: make Blob's constructor more spec-compliant
PR-URL: https://github.com/nodejs/node/pull/37361
Fixes: https://github.com/nodejs/node/issues/37352
Fixes: https://github.com/nodejs/node/issues/37356
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2021-02-28 14:39:53 +01:00
Michaël Zasso
0d564ce214
buffer: make Blob's slice method more spec-compliant
PR-URL: https://github.com/nodejs/node/pull/37361
Fixes: https://github.com/nodejs/node/issues/37335
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2021-02-28 14:39:53 +01:00
cjihrig
c160d88c9e
buffer: add @@toStringTag to Blob
This commit adds the toStringTag to the Blob class to match
the behavior of Chrome and Firefox.

PR-URL: https://github.com/nodejs/node/pull/37336
Fixes: https://github.com/nodejs/node/issues/37337
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2021-02-16 09:16:18 -05:00
cjihrig
3187845980
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: https://github.com/nodejs/node/pull/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>
2021-02-02 10:47:41 +01:00
James M Snell
775b34b822
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: https://github.com/nodejs/node/pull/36811
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
2021-01-24 21:43:34 -05:00