lib: handle throw undefined in assert.throws()#18029
lib: handle throw undefined in assert.throws()#18029bnoordhuis wants to merge 1 commit intonodejs:masterfrom
throw undefined in assert.throws()#18029Conversation
And make `assert.doesNotThrow()` handle it as well. Fixes: nodejs#18027
addaleax
left a comment
There was a problem hiding this comment.
LGTM
Maybe start the commit message with assert:? :)
BridgeAR
left a comment
There was a problem hiding this comment.
LGTM but since this was never documented and never worked before, we might want to add a entry in the changed history part in the documentation.
|
|
||
| const assert = module.exports = ok; | ||
|
|
||
| const NO_EXCEPTION_SENTINEL = {}; |
There was a problem hiding this comment.
Would a symbol work here as well?
There was a problem hiding this comment.
It's merged now but for posterity: yes, but it doesn't add anything extra and it uses more memory than a plain empty object literal.
cjihrig
left a comment
There was a problem hiding this comment.
LGTM. I like the idea of using a symbol for the sentinel.
jasnell
left a comment
There was a problem hiding this comment.
LGTM but also prefer a Symbol for the sentinel
|
Landing this. Can switch the sentinel to a symbol in a separate PR later. |
And make `assert.doesNotThrow()` handle it as well. PR-URL: #18029 Fixes: #18027 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Khaidi Chu <i@2333.moe> Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com> Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
|
Landed in 71203f5 |
|
This is not cherry-picking cleanly to v9.x-staging. If you would like for it to land there, please submit a backport pr. Thanks! |
And make `assert.doesNotThrow()` handle it as well. PR-URL: nodejs#18029 Fixes: nodejs#18027 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Khaidi Chu <i@2333.moe> Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com> Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
|
Backport opened in #19230 |
And make `assert.doesNotThrow()` handle it as well. Backport-PR-URL: #19230 PR-URL: #18029 Fixes: #18027 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Khaidi Chu <i@2333.moe> Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com> Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
And make `assert.doesNotThrow()` handle it as well. Backport-PR-URL: #19230 PR-URL: #18029 Fixes: #18027 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Khaidi Chu <i@2333.moe> Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com> Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
|
Requested backport to 8.x in #19230 |
And make
assert.doesNotThrow()handle it as well.Fixes: #18027