<feed xmlns='http://www.w3.org/2005/Atom'>
<title>delta/node-new.git/lib/assert.js, 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>assert: remove unused catch bindings</title>
<updated>2018-11-06T15:58:42+00:00</updated>
<author>
<name>cjihrig</name>
<email>cjihrig@gmail.com</email>
</author>
<published>2018-11-04T14:59:52+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/node-new.git/commit/?id=39a027224e81681251266cdd104229ae53a0c12a'/>
<id>39a027224e81681251266cdd104229ae53a0c12a</id>
<content type='text'>
PR-URL: https://github.com/nodejs/node/pull/24079
Reviewed-By: Sam Roberts &lt;vieuxtech@gmail.com&gt;
Reviewed-By: Wyatt Preul &lt;wpreul@gmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
PR-URL: https://github.com/nodejs/node/pull/24079
Reviewed-By: Sam Roberts &lt;vieuxtech@gmail.com&gt;
Reviewed-By: Wyatt Preul &lt;wpreul@gmail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>assert: remove internal errorCache property</title>
<updated>2018-10-09T13:39:46+00:00</updated>
<author>
<name>Rich Trott</name>
<email>rtrott@gmail.com</email>
</author>
<published>2018-10-07T01:27:54+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/node-new.git/commit/?id=4d58c08865d7c996bb8cfbe15793443fd425410f'/>
<id>4d58c08865d7c996bb8cfbe15793443fd425410f</id>
<content type='text'>
The internal assert module exposed an errorCache property solely for
testing. It is no longer necessary. Remove it.

PR-URL: https://github.com/nodejs/node/pull/23304
Reviewed-By: Ruben Bridgewater &lt;ruben@bridgewater.de&gt;
Reviewed-By: Sakthipriyan Vairamani &lt;thechargingvolcano@gmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The internal assert module exposed an errorCache property solely for
testing. It is no longer necessary. Remove it.

PR-URL: https://github.com/nodejs/node/pull/23304
Reviewed-By: Ruben Bridgewater &lt;ruben@bridgewater.de&gt;
Reviewed-By: Sakthipriyan Vairamani &lt;thechargingvolcano@gmail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>assert: add default operator to `assert.fail()`</title>
<updated>2018-09-17T13:59:12+00:00</updated>
<author>
<name>Ruben Bridgewater</name>
<email>ruben@bridgewater.de</email>
</author>
<published>2018-09-04T13:18:44+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/node-new.git/commit/?id=eee5adfab5af5f7eb672cbc3cbbad141c455c54d'/>
<id>eee5adfab5af5f7eb672cbc3cbbad141c455c54d</id>
<content type='text'>
This makes sure `assert.fail()` contains an operator instead of being
undefined.

On top of that it also fixes the `err.generatedMessage` property.
Before, it was not always set correct.

PR-URL: https://github.com/nodejs/node/pull/22694
Reviewed-By: John-David Dalton &lt;john.david.dalton@gmail.com&gt;
Reviewed-By: Matteo Collina &lt;matteo.collina@gmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This makes sure `assert.fail()` contains an operator instead of being
undefined.

On top of that it also fixes the `err.generatedMessage` property.
Before, it was not always set correct.

PR-URL: https://github.com/nodejs/node/pull/22694
Reviewed-By: John-David Dalton &lt;john.david.dalton@gmail.com&gt;
Reviewed-By: Matteo Collina &lt;matteo.collina@gmail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>assert: align argument names</title>
<updated>2018-09-11T21:45:07+00:00</updated>
<author>
<name>Ruben Bridgewater</name>
<email>ruben@bridgewater.de</email>
</author>
<published>2018-09-08T00:30:07+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/node-new.git/commit/?id=b5430d782d1c00ecdc421ad28b4f6c5ff62ba972'/>
<id>b5430d782d1c00ecdc421ad28b4f6c5ff62ba972</id>
<content type='text'>
This makes sure the documented argument names and the ones thrown
in errors is aligned with the actual argument name.

PR-URL: https://github.com/nodejs/node/pull/22760
Reviewed-By: Rich Trott &lt;rtrott@gmail.com&gt;
Reviewed-By: Trivikram Kamat &lt;trivikr.dev@gmail.com&gt;
Reviewed-By: Luigi Pinca &lt;luigipinca@gmail.com&gt;
Reviewed-By: James M Snell &lt;jasnell@gmail.com&gt;
Reviewed-By: Denys Otrishko &lt;shishugi@gmail.com&gt;
Reviewed-By: Yuta Hiroto &lt;hello@hiroppy.me&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This makes sure the documented argument names and the ones thrown
in errors is aligned with the actual argument name.

PR-URL: https://github.com/nodejs/node/pull/22760
Reviewed-By: Rich Trott &lt;rtrott@gmail.com&gt;
Reviewed-By: Trivikram Kamat &lt;trivikr.dev@gmail.com&gt;
Reviewed-By: Luigi Pinca &lt;luigipinca@gmail.com&gt;
Reviewed-By: James M Snell &lt;jasnell@gmail.com&gt;
Reviewed-By: Denys Otrishko &lt;shishugi@gmail.com&gt;
Reviewed-By: Yuta Hiroto &lt;hello@hiroppy.me&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>assert: improve simple assert</title>
<updated>2018-07-16T09:30:55+00:00</updated>
<author>
<name>Ruben Bridgewater</name>
<email>ruben@bridgewater.de</email>
</author>
<published>2018-07-02T18:29:57+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/node-new.git/commit/?id=43ee4d692afb7bae224e529c6088d3890b4ea31f'/>
<id>43ee4d692afb7bae224e529c6088d3890b4ea31f</id>
<content type='text'>
1) If simple assert is called in the very first line of a file and
it causes an error, it used to report the wrong code. The reason
is that the column that is reported is faulty. This is fixed by
subtracting the offset from now on in such cases.

2) The actual code read is now limited to the part that is actually
required to visualize the call site. All other code in e.g. minified
files will not cause a significant overhead anymore.

3) The number of allocations is now significantly lower than it used
to be. The buffer is reused until the correct line in the code is
found. In general the algorithm tries to safe operations where
possible.

4) The indentation is now corrected depending on where the statement
actually beginns.

5) It is now possible to handle `.call()` and `.apply()` properly.

6) The user defined function name will now always be used instead of
only choosing either `assert.ok()` or `assert()`.

PR-URL: https://github.com/nodejs/node/pull/21626
Reviewed-By: Matteo Collina &lt;matteo.collina@gmail.com&gt;
Reviewed-By: Ben Coe &lt;bencoe@gmail.com&gt;
Reviewed-By: James M Snell &lt;jasnell@gmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
1) If simple assert is called in the very first line of a file and
it causes an error, it used to report the wrong code. The reason
is that the column that is reported is faulty. This is fixed by
subtracting the offset from now on in such cases.

2) The actual code read is now limited to the part that is actually
required to visualize the call site. All other code in e.g. minified
files will not cause a significant overhead anymore.

3) The number of allocations is now significantly lower than it used
to be. The buffer is reused until the correct line in the code is
found. In general the algorithm tries to safe operations where
possible.

4) The indentation is now corrected depending on where the statement
actually beginns.

5) It is now possible to handle `.call()` and `.apply()` properly.

6) The user defined function name will now always be used instead of
only choosing either `assert.ok()` or `assert()`.

PR-URL: https://github.com/nodejs/node/pull/21626
Reviewed-By: Matteo Collina &lt;matteo.collina@gmail.com&gt;
Reviewed-By: Ben Coe &lt;bencoe@gmail.com&gt;
Reviewed-By: James M Snell &lt;jasnell@gmail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>assert: handle undefined filename in getErrMessage</title>
<updated>2018-05-23T15:40:10+00:00</updated>
<author>
<name>Tim Seckinger</name>
<email>seckinger.tim@gmail.com</email>
</author>
<published>2018-05-20T12:37:28+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/node-new.git/commit/?id=a5d86f8c4ebf201092a7a155691856e13639f0cb'/>
<id>a5d86f8c4ebf201092a7a155691856e13639f0cb</id>
<content type='text'>
When generating an assertion error message,
`filename` might be undefined,
e.g. if `assert` is called in `eval`.

Handle this case gracefully instead of failing with
`Cannot read property 'endsWith' of undefined`.

Fixes: https://github.com/nodejs/node/issues/20847

PR-URL: https://github.com/nodejs/node/pull/20848
Reviewed-By: Ruben Bridgewater &lt;ruben@bridgewater.de&gt;
Reviewed-By: Trivikram Kamat &lt;trivikr.dev@gmail.com&gt;
Reviewed-By: Colin Ihrig &lt;cjihrig@gmail.com&gt;
Reviewed-By: Anna Henningsen &lt;anna@addaleax.net&gt;
Reviewed-By: Benjamin Gruenbaum &lt;benjamingr@gmail.com&gt;
Reviewed-By: Khaidi Chu &lt;i@2333.moe&gt;
Reviewed-By: James M Snell &lt;jasnell@gmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
When generating an assertion error message,
`filename` might be undefined,
e.g. if `assert` is called in `eval`.

Handle this case gracefully instead of failing with
`Cannot read property 'endsWith' of undefined`.

Fixes: https://github.com/nodejs/node/issues/20847

PR-URL: https://github.com/nodejs/node/pull/20848
Reviewed-By: Ruben Bridgewater &lt;ruben@bridgewater.de&gt;
Reviewed-By: Trivikram Kamat &lt;trivikr.dev@gmail.com&gt;
Reviewed-By: Colin Ihrig &lt;cjihrig@gmail.com&gt;
Reviewed-By: Anna Henningsen &lt;anna@addaleax.net&gt;
Reviewed-By: Benjamin Gruenbaum &lt;benjamingr@gmail.com&gt;
Reviewed-By: Khaidi Chu &lt;i@2333.moe&gt;
Reviewed-By: James M Snell &lt;jasnell@gmail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>assert: fix wrong message indentation</title>
<updated>2018-05-21T15:56:56+00:00</updated>
<author>
<name>Ruben Bridgewater</name>
<email>ruben@bridgewater.de</email>
</author>
<published>2018-05-16T16:10:08+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/node-new.git/commit/?id=9c2e67ba97a4af0bb83c621b0c724f84198eac2d'/>
<id>9c2e67ba97a4af0bb83c621b0c724f84198eac2d</id>
<content type='text'>
If code is read from a file and that code is indented, it would be
misaligned. This makes sure it has a natural indentation that is
relative to the starting point of the assertion.

PR-URL: https://github.com/nodejs/node/pull/20791
Reviewed-By: James M Snell &lt;jasnell@gmail.com&gt;
Reviewed-By: Trivikram Kamat &lt;trivikr.dev@gmail.com&gt;
Reviewed-By: Khaidi Chu &lt;i@2333.moe&gt;
Reviewed-By: Matteo Collina &lt;matteo.collina@gmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
If code is read from a file and that code is indented, it would be
misaligned. This makes sure it has a natural indentation that is
relative to the starting point of the assertion.

PR-URL: https://github.com/nodejs/node/pull/20791
Reviewed-By: James M Snell &lt;jasnell@gmail.com&gt;
Reviewed-By: Trivikram Kamat &lt;trivikr.dev@gmail.com&gt;
Reviewed-By: Khaidi Chu &lt;i@2333.moe&gt;
Reviewed-By: Matteo Collina &lt;matteo.collina@gmail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>assert: fix EOL issue in messages on Windows</title>
<updated>2018-05-18T14:09:00+00:00</updated>
<author>
<name>Ruben Bridgewater</name>
<email>ruben@bridgewater.de</email>
</author>
<published>2018-05-15T16:44:19+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/node-new.git/commit/?id=2c42999f7e0cfb4d79124add35e0b19b50100074'/>
<id>2c42999f7e0cfb4d79124add35e0b19b50100074</id>
<content type='text'>
PR-URL: https://github.com/nodejs/node/pull/20754
Reviewed-By: Joyee Cheung &lt;joyeec9h3@gmail.com&gt;
Reviewed-By: James M Snell &lt;jasnell@gmail.com&gt;
Reviewed-By: Trivikram Kamat &lt;trivikr.dev@gmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
PR-URL: https://github.com/nodejs/node/pull/20754
Reviewed-By: Joyee Cheung &lt;joyeec9h3@gmail.com&gt;
Reviewed-By: James M Snell &lt;jasnell@gmail.com&gt;
Reviewed-By: Trivikram Kamat &lt;trivikr.dev@gmail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>assert,util: lazy load comparison functions</title>
<updated>2018-05-18T13:27:29+00:00</updated>
<author>
<name>Ruben Bridgewater</name>
<email>ruben@bridgewater.de</email>
</author>
<published>2018-05-07T01:53:02+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/node-new.git/commit/?id=17d95ea1f0be2204cc040b8b0a9d1144f28baaab'/>
<id>17d95ea1f0be2204cc040b8b0a9d1144f28baaab</id>
<content type='text'>
PR-URL: https://github.com/nodejs/node/pull/20567
Reviewed-By: Gus Caplan &lt;me@gus.host&gt;
Reviewed-By: Matteo Collina &lt;matteo.collina@gmail.com&gt;
Reviewed-By: James M Snell &lt;jasnell@gmail.com&gt;
Reviewed-By: Jeremiah Senkpiel &lt;fishrock123@rocketmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
PR-URL: https://github.com/nodejs/node/pull/20567
Reviewed-By: Gus Caplan &lt;me@gus.host&gt;
Reviewed-By: Matteo Collina &lt;matteo.collina@gmail.com&gt;
Reviewed-By: James M Snell &lt;jasnell@gmail.com&gt;
Reviewed-By: Jeremiah Senkpiel &lt;fishrock123@rocketmail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>os: lazy loaded</title>
<updated>2018-05-18T13:25:41+00:00</updated>
<author>
<name>Ruben Bridgewater</name>
<email>ruben@bridgewater.de</email>
</author>
<published>2018-05-06T21:10:23+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/node-new.git/commit/?id=d478e52fe0bc396c8e65baf0861553a0d3de99db'/>
<id>d478e52fe0bc396c8e65baf0861553a0d3de99db</id>
<content type='text'>
PR-URL: https://github.com/nodejs/node/pull/20567
Reviewed-By: Gus Caplan &lt;me@gus.host&gt;
Reviewed-By: Matteo Collina &lt;matteo.collina@gmail.com&gt;
Reviewed-By: James M Snell &lt;jasnell@gmail.com&gt;
Reviewed-By: Jeremiah Senkpiel &lt;fishrock123@rocketmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
PR-URL: https://github.com/nodejs/node/pull/20567
Reviewed-By: Gus Caplan &lt;me@gus.host&gt;
Reviewed-By: Matteo Collina &lt;matteo.collina@gmail.com&gt;
Reviewed-By: James M Snell &lt;jasnell@gmail.com&gt;
Reviewed-By: Jeremiah Senkpiel &lt;fishrock123@rocketmail.com&gt;
</pre>
</div>
</content>
</entry>
</feed>
