Uh oh!
There was an error while loading. Please reload this page.
assert: handle undefined filename in getErrMessage - #20848
Conversation
BridgeAR
commented
May 20, 2018
@jeysal thanks a lot for reporting and fixing this! |
BridgeAR
commented
May 20, 2018
benjamingr
left a comment
There was a problem hiding this comment.
Excellent first contribution - good job!
benjamingr
commented
May 20, 2018
CI failures look unrelated. Retried just in case https://ci.nodejs.org/job/node-test-commit/18635/console |
apapirovski
commented
May 21, 2018
Just my 2c but wouldn't we prefer to just bail out early before even checking the Map? Then we don't need to store extra values or run all that extra code... |
BridgeAR
commented
May 21, 2018
@apapirovski we could bail out right after checking for a filename but that should not make a significant difference. |
jeysal
commented
May 21, 2018
I guess that would indeed save some cache entries. Might look nicer to have both exit conditions in one place though. Would anyone else prefer splitting them? |
BridgeAR
commented
May 21, 2018
@jeysal if you do not mind, moving would be better. |
d267d28 to
86b8330CompareWhen 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: nodejs#20847
86b8330 to
0118fcdComparejeysal
commented
May 21, 2018
done |
jasnell
commented
May 23, 2018
Way too much red and yellow in the last CI run, trying again: https://ci.nodejs.org/job/node-test-pull-request/15055/ |
jasnell
commented
May 23, 2018
Still a lot of red in the CI but none of it related. |
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: #20847 PR-URL: #20848 Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Khaidi Chu <i@2333.moe> Reviewed-By: James M Snell <jasnell@gmail.com>
jasnell
commented
May 23, 2018
Landed in a5d86f8 |
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: #20847 PR-URL: #20848 Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Khaidi Chu <i@2333.moe> Reviewed-By: James M Snell <jasnell@gmail.com>
When generating an assertion error message,
filenamemight be undefined,e.g. if
assertis called ineval.Handle this case gracefully instead of failing with
Cannot read property 'endsWith' of undefined.Fixes: #20847
Checklist
make -j4 test(UNIX), orvcbuild test(Windows) passes