<feed xmlns='http://www.w3.org/2005/Atom'>
<title>delta/node-new.git/src/node_buffer.cc, branch pull-request-doc-updates</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>src: use nullptr in node_buffer.cc</title>
<updated>2019-02-04T06:21:53+00:00</updated>
<author>
<name>gengjiawen</name>
<email>technicalcute@gmail.com</email>
</author>
<published>2019-01-30T15:43:20+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/node-new.git/commit/?id=66f08fdf8bfef2a20aaded049763655f048169ef'/>
<id>66f08fdf8bfef2a20aaded049763655f048169ef</id>
<content type='text'>
Signed-off-by: gengjiawen &lt;technicalcute@gmail.com&gt;

PR-URL: https://github.com/nodejs/node/pull/25820
Reviewed-By: Anna Henningsen &lt;anna@addaleax.net&gt;
Reviewed-By: James M Snell &lt;jasnell@gmail.com&gt;
Reviewed-By: Richard Lau &lt;riclau@uk.ibm.com&gt;
Reviewed-By: Luigi Pinca &lt;luigipinca@gmail.com&gt;
Reviewed-By: Colin Ihrig &lt;cjihrig@gmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Signed-off-by: gengjiawen &lt;technicalcute@gmail.com&gt;

PR-URL: https://github.com/nodejs/node/pull/25820
Reviewed-By: Anna Henningsen &lt;anna@addaleax.net&gt;
Reviewed-By: James M Snell &lt;jasnell@gmail.com&gt;
Reviewed-By: Richard Lau &lt;riclau@uk.ibm.com&gt;
Reviewed-By: Luigi Pinca &lt;luigipinca@gmail.com&gt;
Reviewed-By: Colin Ihrig &lt;cjihrig@gmail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>src: remove outdated `Neuter()` call in `node_buffer.cc`</title>
<updated>2019-01-21T19:34:48+00:00</updated>
<author>
<name>Anna Henningsen</name>
<email>anna@addaleax.net</email>
</author>
<published>2019-01-13T20:53:31+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/node-new.git/commit/?id=30f45683aaeb1d4917fff7bc7cb2937ee89f0082'/>
<id>30f45683aaeb1d4917fff7bc7cb2937ee89f0082</id>
<content type='text'>
This call was introduced in 827ee498e332e3 to avoid a crash in a
later `Neuter()` call that has later been removed in ebbbc5a790db69,
rendering the original call unnecessary.

Refs: https://github.com/nodejs/node/pull/3624
Refs: https://github.com/nodejs/node/pull/5204

PR-URL: https://github.com/nodejs/node/pull/25479
Reviewed-By: Anatoli Papirovski &lt;apapirovski@mac.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This call was introduced in 827ee498e332e3 to avoid a crash in a
later `Neuter()` call that has later been removed in ebbbc5a790db69,
rendering the original call unnecessary.

Refs: https://github.com/nodejs/node/pull/3624
Refs: https://github.com/nodejs/node/pull/5204

PR-URL: https://github.com/nodejs/node/pull/25479
Reviewed-By: Anatoli Papirovski &lt;apapirovski@mac.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>src: reduce includes of node_internals.h</title>
<updated>2019-01-21T06:54:42+00:00</updated>
<author>
<name>Joyee Cheung</name>
<email>joyeec9h3@gmail.com</email>
</author>
<published>2019-01-13T09:17:26+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/node-new.git/commit/?id=1838d00eba30708dd8468a5707489d1ff6bb8a9d'/>
<id>1838d00eba30708dd8468a5707489d1ff6bb8a9d</id>
<content type='text'>
PR-URL: https://github.com/nodejs/node/pull/25507
Reviewed-By: Daniel Bevenius &lt;daniel.bevenius@gmail.com&gt;
Reviewed-By: Ben Noordhuis &lt;info@bnoordhuis.nl&gt;
Reviewed-By: Colin Ihrig &lt;cjihrig@gmail.com&gt;
Reviewed-By: Anna Henningsen &lt;anna@addaleax.net&gt;
Reviewed-By: James M Snell &lt;jasnell@gmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
PR-URL: https://github.com/nodejs/node/pull/25507
Reviewed-By: Daniel Bevenius &lt;daniel.bevenius@gmail.com&gt;
Reviewed-By: Ben Noordhuis &lt;info@bnoordhuis.nl&gt;
Reviewed-By: Colin Ihrig &lt;cjihrig@gmail.com&gt;
Reviewed-By: Anna Henningsen &lt;anna@addaleax.net&gt;
Reviewed-By: James M Snell &lt;jasnell@gmail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>buffer: move initialization of buffer prototype into node.js</title>
<updated>2019-01-10T08:59:24+00:00</updated>
<author>
<name>Joyee Cheung</name>
<email>joyeec9h3@gmail.com</email>
</author>
<published>2018-12-31T08:11:01+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/node-new.git/commit/?id=97f59b95675b80a8d8df1d0e9c179c06c0c86a7b'/>
<id>97f59b95675b80a8d8df1d0e9c179c06c0c86a7b</id>
<content type='text'>
Instead of exposing it in `lib/internal/buffer.js` after deleting
it from the binding and then do the initialization in
`lib/buffer.js`, which results in an implicit dependency on
the order in which these modules are loaded.

PR-URL: https://github.com/nodejs/node/pull/25292
Reviewed-By: Anna Henningsen &lt;anna@addaleax.net&gt;
Reviewed-By: James M Snell &lt;jasnell@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>
Instead of exposing it in `lib/internal/buffer.js` after deleting
it from the binding and then do the initialization in
`lib/buffer.js`, which results in an implicit dependency on
the order in which these modules are loaded.

PR-URL: https://github.com/nodejs/node/pull/25292
Reviewed-By: Anna Henningsen &lt;anna@addaleax.net&gt;
Reviewed-By: James M Snell &lt;jasnell@gmail.com&gt;
Reviewed-By: Ruben Bridgewater &lt;ruben@bridgewater.de&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>src: move per-process global variables into node::per_process</title>
<updated>2019-01-07T23:28:16+00:00</updated>
<author>
<name>Joyee Cheung</name>
<email>joyeec9h3@gmail.com</email>
</author>
<published>2019-01-01T05:56:53+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/node-new.git/commit/?id=9db9e7e541c1ff9a30b7f1b61c6d3a7b6d30fab3'/>
<id>9db9e7e541c1ff9a30b7f1b61c6d3a7b6d30fab3</id>
<content type='text'>
So that it's easier to tell whether we are manipulating per-process
global states that may need to be treated with care to avoid races.

Also added comments about these variables and moved some of them
to a more suitable compilation unit:

- Move `v8_initialized` to `util.h` since it's only used in
  `util.cc` and `node.cc`
- Rename `process_mutex` to `tty_mutex` and move it into
  `node_errors.cc` since that's the only place it's used
  to guard the tty.
- Move `per_process_opts_mutex` and `per_process_opts`
  into `node_options.h` and rename them to
  `per_process::cli_options[_mutex]`
- Rename `node_isolate[_mutex]` to `per_process::main_isolate[_mutex]`

PR-URL: https://github.com/nodejs/node/pull/25302
Reviewed-By: Anna Henningsen &lt;anna@addaleax.net&gt;
Reviewed-By: James M Snell &lt;jasnell@gmail.com&gt;
Reviewed-By: Franziska Hinkelmann &lt;franziska.hinkelmann@gmail.com&gt;
Reviewed-By: Ben Noordhuis &lt;info@bnoordhuis.nl&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
So that it's easier to tell whether we are manipulating per-process
global states that may need to be treated with care to avoid races.

Also added comments about these variables and moved some of them
to a more suitable compilation unit:

- Move `v8_initialized` to `util.h` since it's only used in
  `util.cc` and `node.cc`
- Rename `process_mutex` to `tty_mutex` and move it into
  `node_errors.cc` since that's the only place it's used
  to guard the tty.
- Move `per_process_opts_mutex` and `per_process_opts`
  into `node_options.h` and rename them to
  `per_process::cli_options[_mutex]`
- Rename `node_isolate[_mutex]` to `per_process::main_isolate[_mutex]`

PR-URL: https://github.com/nodejs/node/pull/25302
Reviewed-By: Anna Henningsen &lt;anna@addaleax.net&gt;
Reviewed-By: James M Snell &lt;jasnell@gmail.com&gt;
Reviewed-By: Franziska Hinkelmann &lt;franziska.hinkelmann@gmail.com&gt;
Reviewed-By: Ben Noordhuis &lt;info@bnoordhuis.nl&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>buffer: fix crash for invalid index types</title>
<updated>2018-12-31T00:13:00+00:00</updated>
<author>
<name>Anna Henningsen</name>
<email>anna@addaleax.net</email>
</author>
<published>2018-10-21T04:44:48+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/node-new.git/commit/?id=76ecec208266d2f49660e5db2a8ebbbcc1d841c7'/>
<id>76ecec208266d2f49660e5db2a8ebbbcc1d841c7</id>
<content type='text'>
2555cb4a4049dc4c41d8a2f4ce50909cc0a12a4a introduced a crash
when a non-number value was passed to `ParseArrayIndex()`.

We do not always have JS typechecking for that in place, though.
This returns back to the previous behavior of coercing values
to integers, which is certainly questionable.

Refs: https://github.com/nodejs/node/pull/22129
Fixes: https://github.com/nodejs/node/issues/23668

PR-URL: https://github.com/nodejs/node/pull/25154
Reviewed-By: James M Snell &lt;jasnell@gmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
2555cb4a4049dc4c41d8a2f4ce50909cc0a12a4a introduced a crash
when a non-number value was passed to `ParseArrayIndex()`.

We do not always have JS typechecking for that in place, though.
This returns back to the previous behavior of coercing values
to integers, which is certainly questionable.

Refs: https://github.com/nodejs/node/pull/22129
Fixes: https://github.com/nodejs/node/issues/23668

PR-URL: https://github.com/nodejs/node/pull/25154
Reviewed-By: James M Snell &lt;jasnell@gmail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>src: fix type mismatch warnings from missing priv</title>
<updated>2018-12-04T03:44:15+00:00</updated>
<author>
<name>Sam Roberts</name>
<email>vieuxtech@gmail.com</email>
</author>
<published>2018-11-30T01:24:47+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/node-new.git/commit/?id=0c65314e0e8602f4a7e0ace43ebd63de233eac62'/>
<id>0c65314e0e8602f4a7e0ace43ebd63de233eac62</id>
<content type='text'>
Registration initialization functions are expected to have a 4th
argument, a void*, so add them where necessary to fix the warnings.

PR-URL: https://github.com/nodejs/node/pull/24737
Reviewed-By: Anna Henningsen &lt;anna@addaleax.net&gt;
Reviewed-By: Colin Ihrig &lt;cjihrig@gmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Registration initialization functions are expected to have a 4th
argument, a void*, so add them where necessary to fix the warnings.

PR-URL: https://github.com/nodejs/node/pull/24737
Reviewed-By: Anna Henningsen &lt;anna@addaleax.net&gt;
Reviewed-By: Colin Ihrig &lt;cjihrig@gmail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>buffer: do proper error propagation in addon methods</title>
<updated>2018-11-04T11:00:35+00:00</updated>
<author>
<name>Anna Henningsen</name>
<email>anna@addaleax.net</email>
</author>
<published>2018-10-28T15:22:44+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/node-new.git/commit/?id=c6d29ccf5a1aa079d624b23854640225d6eadb55'/>
<id>c6d29ccf5a1aa079d624b23854640225d6eadb55</id>
<content type='text'>
- Always fulfill the `MaybeLocal&lt;&gt;` contract by scheduling an
  exception when returning an empty value. This was previously
  inconsistent, with no way to know whether an exception was
  be scheduled or not in case of failure.
- Make sure that memory is released exactly once in case of
  failure. Previously, some exit conditions would have leaked
  memory or attempted to free it multiple times.

This should not really affect how `Buffer`s are created by
addons in practice, due to the low frequency with which
these errors would typically occur.

PR-URL: https://github.com/nodejs/node/pull/23939
Reviewed-By: Refael Ackermann &lt;refack@gmail.com&gt;
Reviewed-By: James M Snell &lt;jasnell@gmail.com&gt;
Reviewed-By: Joyee Cheung &lt;joyeec9h3@gmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
- Always fulfill the `MaybeLocal&lt;&gt;` contract by scheduling an
  exception when returning an empty value. This was previously
  inconsistent, with no way to know whether an exception was
  be scheduled or not in case of failure.
- Make sure that memory is released exactly once in case of
  failure. Previously, some exit conditions would have leaked
  memory or attempted to free it multiple times.

This should not really affect how `Buffer`s are created by
addons in practice, due to the low frequency with which
these errors would typically occur.

PR-URL: https://github.com/nodejs/node/pull/23939
Reviewed-By: Refael Ackermann &lt;refack@gmail.com&gt;
Reviewed-By: James M Snell &lt;jasnell@gmail.com&gt;
Reviewed-By: Joyee Cheung &lt;joyeec9h3@gmail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>buffer: throw exception when creating from non-Node.js Context</title>
<updated>2018-11-04T06:31:03+00:00</updated>
<author>
<name>Anna Henningsen</name>
<email>anna@addaleax.net</email>
</author>
<published>2018-10-28T14:59:20+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/node-new.git/commit/?id=9c7d19104d1f03f70658a6834a7d0baac7d38724'/>
<id>9c7d19104d1f03f70658a6834a7d0baac7d38724</id>
<content type='text'>
Throw an exception instead of crashing when attempting to create
`Buffer` objects from a Context that is not associated with
a Node.js `Environment`.

Possible alternatives for the future might be just returning
a plain `Uint8Array`, or working on providing `Buffer` for all
`Context`s.

PR-URL: https://github.com/nodejs/node/pull/23938
Reviewed-By: James M Snell &lt;jasnell@gmail.com&gt;
Reviewed-By: Daniel Bevenius &lt;daniel.bevenius@gmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Throw an exception instead of crashing when attempting to create
`Buffer` objects from a Context that is not associated with
a Node.js `Environment`.

Possible alternatives for the future might be just returning
a plain `Uint8Array`, or working on providing `Buffer` for all
`Context`s.

PR-URL: https://github.com/nodejs/node/pull/23938
Reviewed-By: James M Snell &lt;jasnell@gmail.com&gt;
Reviewed-By: Daniel Bevenius &lt;daniel.bevenius@gmail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>src: minor refactor to node_errors.h</title>
<updated>2018-10-28T14:05:10+00:00</updated>
<author>
<name>Anna Henningsen</name>
<email>anna@addaleax.net</email>
</author>
<published>2018-10-25T17:35:17+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/node-new.git/commit/?id=0fd55e71fe376458d1d82503a643114db8675208'/>
<id>0fd55e71fe376458d1d82503a643114db8675208</id>
<content type='text'>
Add overloads of the error generation/throwing methods
that take an `Isolate*` argument, since the created objects
don’t depend on the `Environment*` in question.

Also, remove `THROW_ERR_OUT_OF_RANGE_WITH_TEXT`, which did the
same thing as `THROW_ERR_OUT_OF_RANGE` in a more convoluted way.

PR-URL: https://github.com/nodejs/node/pull/23879
Reviewed-By: James M Snell &lt;jasnell@gmail.com&gt;
Reviewed-By: Eugene Ostroukhov &lt;eostroukhov@google.com&gt;
Reviewed-By: Colin Ihrig &lt;cjihrig@gmail.com&gt;
Reviewed-By: Matheus Marchini &lt;mat@mmarchini.me&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Add overloads of the error generation/throwing methods
that take an `Isolate*` argument, since the created objects
don’t depend on the `Environment*` in question.

Also, remove `THROW_ERR_OUT_OF_RANGE_WITH_TEXT`, which did the
same thing as `THROW_ERR_OUT_OF_RANGE` in a more convoluted way.

PR-URL: https://github.com/nodejs/node/pull/23879
Reviewed-By: James M Snell &lt;jasnell@gmail.com&gt;
Reviewed-By: Eugene Ostroukhov &lt;eostroukhov@google.com&gt;
Reviewed-By: Colin Ihrig &lt;cjihrig@gmail.com&gt;
Reviewed-By: Matheus Marchini &lt;mat@mmarchini.me&gt;
</pre>
</div>
</content>
</entry>
</feed>
