<feed xmlns='http://www.w3.org/2005/Atom'>
<title>delta/node-new.git/lib/buffer.js, branch devsnek-patch-1</title>
<subtitle>github.com: nodejs/node.git
</subtitle>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/node-new.git/'/>
<entry>
<title>lib: use remaining typed arrays from primordials</title>
<updated>2020-10-07T13:44:21+00:00</updated>
<author>
<name>Michaël Zasso</name>
<email>targos@protonmail.com</email>
</author>
<published>2020-09-28T14:56:54+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/node-new.git/commit/?id=14699846452e627f97dedb85991eea67d932a79d'/>
<id>14699846452e627f97dedb85991eea67d932a79d</id>
<content type='text'>
PR-URL: https://github.com/nodejs/node/pull/35499
Reviewed-By: Joyee Cheung &lt;joyeec9h3@gmail.com&gt;
Reviewed-By: Benjamin Gruenbaum &lt;benjamingr@gmail.com&gt;
Reviewed-By: Anna Henningsen &lt;anna@addaleax.net&gt;
Reviewed-By: Rich Trott &lt;rtrott@gmail.com&gt;
Reviewed-By: Ujjwal Sharma &lt;ryzokuken@disroot.org&gt;
Reviewed-By: Shingo Inoue &lt;leko.noor@gmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
PR-URL: https://github.com/nodejs/node/pull/35499
Reviewed-By: Joyee Cheung &lt;joyeec9h3@gmail.com&gt;
Reviewed-By: Benjamin Gruenbaum &lt;benjamingr@gmail.com&gt;
Reviewed-By: Anna Henningsen &lt;anna@addaleax.net&gt;
Reviewed-By: Rich Trott &lt;rtrott@gmail.com&gt;
Reviewed-By: Ujjwal Sharma &lt;ryzokuken@disroot.org&gt;
Reviewed-By: Shingo Inoue &lt;leko.noor@gmail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>buffer: adjust validation to account for buffer.kMaxLength</title>
<updated>2020-09-12T11:17:59+00:00</updated>
<author>
<name>Anna Henningsen</name>
<email>anna@addaleax.net</email>
</author>
<published>2020-09-09T21:11:21+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/node-new.git/commit/?id=3c564632fafd0400fb6123cc398d736b6dbec7e6'/>
<id>3c564632fafd0400fb6123cc398d736b6dbec7e6</id>
<content type='text'>
PR-URL: https://github.com/nodejs/node/pull/35134
Reviewed-By: Ruben Bridgewater &lt;ruben@bridgewater.de&gt;
Reviewed-By: James M Snell &lt;jasnell@gmail.com&gt;
Reviewed-By: Yongsheng Zhang &lt;zyszys98@gmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
PR-URL: https://github.com/nodejs/node/pull/35134
Reviewed-By: Ruben Bridgewater &lt;ruben@bridgewater.de&gt;
Reviewed-By: James M Snell &lt;jasnell@gmail.com&gt;
Reviewed-By: Yongsheng Zhang &lt;zyszys98@gmail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>lib: remove ERR_INVALID_OPT_VALUE and ERR_INVALID_OPT_VALUE_ENCODING</title>
<updated>2020-09-11T14:54:42+00:00</updated>
<author>
<name>Denys Otrishko</name>
<email>shishugi@gmail.com</email>
</author>
<published>2020-08-08T16:01:59+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/node-new.git/commit/?id=c66e6471e780e752f3f6f9337ac49a3d6e3d7091'/>
<id>c66e6471e780e752f3f6f9337ac49a3d6e3d7091</id>
<content type='text'>
This will be a start to generalize all argument validation
errors. As currently we throw ARG/OPT, OUT_OF_RANGE, and other more
specific errors.
The OPT errors didn't bring much to the errors as it's just another
variant of ARG error which is sometimes more confusing (some of our code
used OPT errors to denote just argument validation errors presumably
because of similarity of OPT to 'option' and not 'options-object')
and they don't specify the name of the options object where the invalid
value is located. Much better approach would be to just specify path
to the invalid value in the name of the value as it is done in this PR
(i.e. 'options.format', 'options.publicKey.type' etc)

Also since this decreases a variety of errors we have it'd be easier to
reuse validation code across the codebase.

Refs: https://github.com/nodejs/node/pull/31251
Refs: https://github.com/nodejs/node/pull/34070#discussion_r467251009
Signed-off-by: Denys Otrishko &lt;shishugi@gmail.com&gt;

PR-URL: https://github.com/nodejs/node/pull/34682
Reviewed-By: Matteo Collina &lt;matteo.collina@gmail.com&gt;
Reviewed-By: Ruben Bridgewater &lt;ruben@bridgewater.de&gt;
Reviewed-By: James M Snell &lt;jasnell@gmail.com&gt;
Reviewed-By: Rich Trott &lt;rtrott@gmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This will be a start to generalize all argument validation
errors. As currently we throw ARG/OPT, OUT_OF_RANGE, and other more
specific errors.
The OPT errors didn't bring much to the errors as it's just another
variant of ARG error which is sometimes more confusing (some of our code
used OPT errors to denote just argument validation errors presumably
because of similarity of OPT to 'option' and not 'options-object')
and they don't specify the name of the options object where the invalid
value is located. Much better approach would be to just specify path
to the invalid value in the name of the value as it is done in this PR
(i.e. 'options.format', 'options.publicKey.type' etc)

Also since this decreases a variety of errors we have it'd be easier to
reuse validation code across the codebase.

Refs: https://github.com/nodejs/node/pull/31251
Refs: https://github.com/nodejs/node/pull/34070#discussion_r467251009
Signed-off-by: Denys Otrishko &lt;shishugi@gmail.com&gt;

PR-URL: https://github.com/nodejs/node/pull/34682
Reviewed-By: Matteo Collina &lt;matteo.collina@gmail.com&gt;
Reviewed-By: Ruben Bridgewater &lt;ruben@bridgewater.de&gt;
Reviewed-By: James M Snell &lt;jasnell@gmail.com&gt;
Reviewed-By: Rich Trott &lt;rtrott@gmail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>src: reset zero fill toggle at pre-execution</title>
<updated>2020-07-18T03:23:16+00:00</updated>
<author>
<name>Joyee Cheung</name>
<email>joyeec9h3@gmail.com</email>
</author>
<published>2020-05-07T12:21:45+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/node-new.git/commit/?id=c943cb4809d382d1816a5f435c0eacc14e750ab2'/>
<id>c943cb4809d382d1816a5f435c0eacc14e750ab2</id>
<content type='text'>
The connection between the JS land zero fill toggle and the
C++ one in the NodeArrayBufferAllocator gets lost if the toggle
is deserialized from the snapshot, because V8 owns the underlying
memory of this toggle. This resets the connection at pre-execution.

PR-URL: https://github.com/nodejs/node/pull/32984
Reviewed-By: Anna Henningsen &lt;anna@addaleax.net&gt;
Reviewed-By: Daniel Bevenius &lt;daniel.bevenius@gmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The connection between the JS land zero fill toggle and the
C++ one in the NodeArrayBufferAllocator gets lost if the toggle
is deserialized from the snapshot, because V8 owns the underlying
memory of this toggle. This resets the connection at pre-execution.

PR-URL: https://github.com/nodejs/node/pull/32984
Reviewed-By: Anna Henningsen &lt;anna@addaleax.net&gt;
Reviewed-By: Daniel Bevenius &lt;daniel.bevenius@gmail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>worker: add public method for marking objects as untransferable</title>
<updated>2020-06-25T15:33:29+00:00</updated>
<author>
<name>Anna Henningsen</name>
<email>anna@addaleax.net</email>
</author>
<published>2020-06-19T18:39:23+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/node-new.git/commit/?id=88fb5a5c7933022de750745e51e5dc0996a1e2c4'/>
<id>88fb5a5c7933022de750745e51e5dc0996a1e2c4</id>
<content type='text'>
We currently mark a number of `ArrayBuffer`s as not transferable,
including the `Buffer` pool and ones with finalizers provided
by C++ addons.

There is no good reason to assume that userland code might not
encounter similar problems, for example when doing `ArrayBuffer`
pooling similar to ours. Therefore, provide an API that lets
userland code also mark objects as not transferable.

PR-URL: https://github.com/nodejs/node/pull/33979
Reviewed-By: James M Snell &lt;jasnell@gmail.com&gt;
Reviewed-By: Gus Caplan &lt;me@gus.host&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
We currently mark a number of `ArrayBuffer`s as not transferable,
including the `Buffer` pool and ones with finalizers provided
by C++ addons.

There is no good reason to assume that userland code might not
encounter similar problems, for example when doing `ArrayBuffer`
pooling similar to ours. Therefore, provide an API that lets
userland code also mark objects as not transferable.

PR-URL: https://github.com/nodejs/node/pull/33979
Reviewed-By: James M Snell &lt;jasnell@gmail.com&gt;
Reviewed-By: Gus Caplan &lt;me@gus.host&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>buffer: remove hoisted variable</title>
<updated>2020-05-23T18:47:02+00:00</updated>
<author>
<name>Nikolai Vavilov</name>
<email>vvnicholas@gmail.com</email>
</author>
<published>2020-05-19T14:51:55+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/node-new.git/commit/?id=9cd83c761f688079efeae931cb3462b9ba6d18e3'/>
<id>9cd83c761f688079efeae931cb3462b9ba6d18e3</id>
<content type='text'>
PR-URL: https://github.com/nodejs/node/pull/33470
Reviewed-By: Anna Henningsen &lt;anna@addaleax.net&gt;
Reviewed-By: Colin Ihrig &lt;cjihrig@gmail.com&gt;
Reviewed-By: James M Snell &lt;jasnell@gmail.com&gt;
Reviewed-By: Luigi Pinca &lt;luigipinca@gmail.com&gt;
Reviewed-By: Juan José Arboleda &lt;soyjuanarbol@gmail.com&gt;
Reviewed-By: Ruben Bridgewater &lt;ruben@bridgewater.de&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
PR-URL: https://github.com/nodejs/node/pull/33470
Reviewed-By: Anna Henningsen &lt;anna@addaleax.net&gt;
Reviewed-By: Colin Ihrig &lt;cjihrig@gmail.com&gt;
Reviewed-By: James M Snell &lt;jasnell@gmail.com&gt;
Reviewed-By: Luigi Pinca &lt;luigipinca@gmail.com&gt;
Reviewed-By: Juan José Arboleda &lt;soyjuanarbol@gmail.com&gt;
Reviewed-By: Ruben Bridgewater &lt;ruben@bridgewater.de&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>buffer: improve copy() performance</title>
<updated>2020-05-09T06:04:10+00:00</updated>
<author>
<name>Nikolai Vavilov</name>
<email>vvnicholas@gmail.com</email>
</author>
<published>2020-05-02T17:30:44+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/node-new.git/commit/?id=339690ce9b78da84bf9ea1b4dc9107da91ee4041'/>
<id>339690ce9b78da84bf9ea1b4dc9107da91ee4041</id>
<content type='text'>
There is no need to create a slice when sourceEnd is out of bounds.

PR-URL: https://github.com/nodejs/node/pull/33214
Reviewed-By: Anna Henningsen &lt;anna@addaleax.net&gt;
Reviewed-By: Colin Ihrig &lt;cjihrig@gmail.com&gt;
Reviewed-By: Zeyu Yang &lt;himself65@outlook.com&gt;
Reviewed-By: Luigi Pinca &lt;luigipinca@gmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
There is no need to create a slice when sourceEnd is out of bounds.

PR-URL: https://github.com/nodejs/node/pull/33214
Reviewed-By: Anna Henningsen &lt;anna@addaleax.net&gt;
Reviewed-By: Colin Ihrig &lt;cjihrig@gmail.com&gt;
Reviewed-By: Zeyu Yang &lt;himself65@outlook.com&gt;
Reviewed-By: Luigi Pinca &lt;luigipinca@gmail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>buffer: add type check in bidirectionalIndexOf</title>
<updated>2020-04-13T21:22:09+00:00</updated>
<author>
<name>Gerhard Stoebich</name>
<email>18708370+Flarna@users.noreply.github.com</email>
</author>
<published>2020-04-10T18:25:48+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/node-new.git/commit/?id=aa34465ae3135adeee3fc4e120db8f13e8781404'/>
<id>aa34465ae3135adeee3fc4e120db8f13e8781404</id>
<content type='text'>
Add a type check in bidirectionalIndexOf to avoid using something else
as Buffer. This may happen if e.g. lastIndexOf is called with invalid
this.

PR-URL: https://github.com/nodejs/node/pull/32770
Fixes: https://github.com/nodejs/node/issues/32753
Fixes: https://github.com/nodejs/node/issues/32747
Reviewed-By: Anna Henningsen &lt;anna@addaleax.net&gt;
Reviewed-By: Ruben Bridgewater &lt;ruben@bridgewater.de&gt;
Reviewed-By: Yongsheng Zhang &lt;zyszys98@gmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Add a type check in bidirectionalIndexOf to avoid using something else
as Buffer. This may happen if e.g. lastIndexOf is called with invalid
this.

PR-URL: https://github.com/nodejs/node/pull/32770
Fixes: https://github.com/nodejs/node/issues/32753
Fixes: https://github.com/nodejs/node/issues/32747
Reviewed-By: Anna Henningsen &lt;anna@addaleax.net&gt;
Reviewed-By: Ruben Bridgewater &lt;ruben@bridgewater.de&gt;
Reviewed-By: Yongsheng Zhang &lt;zyszys98@gmail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>buffer: mark pool ArrayBuffer as untransferable</title>
<updated>2020-04-13T16:47:27+00:00</updated>
<author>
<name>Anna Henningsen</name>
<email>anna@addaleax.net</email>
</author>
<published>2020-04-10T10:43:15+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/node-new.git/commit/?id=bb5e7097e89685787e2a81e67512f32132b4606c'/>
<id>bb5e7097e89685787e2a81e67512f32132b4606c</id>
<content type='text'>
This removes a footgun in which users could attempt to transfer the
pooled ArrayBuffer underlying a regular `Buffer`, which would lead to
all `Buffer`s that share the same pool being rendered unusable as well,
and potentially break creation of new pooled `Buffer`s.

This disables this kind of transfer.

Refs: https://github.com/nodejs/node/issues/32752

PR-URL: https://github.com/nodejs/node/pull/32759
Reviewed-By: Ben Noordhuis &lt;info@bnoordhuis.nl&gt;
Reviewed-By: Richard Lau &lt;riclau@uk.ibm.com&gt;
Reviewed-By: Colin Ihrig &lt;cjihrig@gmail.com&gt;
Reviewed-By: Gus Caplan &lt;me@gus.host&gt;
Reviewed-By: James M Snell &lt;jasnell@gmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This removes a footgun in which users could attempt to transfer the
pooled ArrayBuffer underlying a regular `Buffer`, which would lead to
all `Buffer`s that share the same pool being rendered unusable as well,
and potentially break creation of new pooled `Buffer`s.

This disables this kind of transfer.

Refs: https://github.com/nodejs/node/issues/32752

PR-URL: https://github.com/nodejs/node/pull/32759
Reviewed-By: Ben Noordhuis &lt;info@bnoordhuis.nl&gt;
Reviewed-By: Richard Lau &lt;riclau@uk.ibm.com&gt;
Reviewed-By: Colin Ihrig &lt;cjihrig@gmail.com&gt;
Reviewed-By: Gus Caplan &lt;me@gus.host&gt;
Reviewed-By: James M Snell &lt;jasnell@gmail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>buffer: improve from() performance</title>
<updated>2020-02-09T02:40:49+00:00</updated>
<author>
<name>Brian White</name>
<email>mscdex@mscdex.net</email>
</author>
<published>2020-02-02T15:49:30+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/node-new.git/commit/?id=74291e4a7ba6185c1b78a110538ed3db3bc6b244'/>
<id>74291e4a7ba6185c1b78a110538ed3db3bc6b244</id>
<content type='text'>
PR-URL: https://github.com/nodejs/node/pull/31615
Reviewed-By: James M Snell &lt;jasnell@gmail.com&gt;
Reviewed-By: Anna Henningsen &lt;anna@addaleax.net&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
PR-URL: https://github.com/nodejs/node/pull/31615
Reviewed-By: James M Snell &lt;jasnell@gmail.com&gt;
Reviewed-By: Anna Henningsen &lt;anna@addaleax.net&gt;
</pre>
</div>
</content>
</entry>
</feed>
