| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
There was a problem hiding this comment.
LGTM, although I can't reproduce the reported behavior (which is against v17.x) with v18.2.0. This is what I see instead:
> util.inspect({get [Symbol.iterator](){ throw Error("boom") }})
Uncaught Error: boom
at get [Symbol.iterator] (REPL1:1:46)
at formatRaw (node:internal/util/inspect:857:12)
at formatValue (node:internal/util/inspect:817:10)
at Object.inspect (node:internal/util/inspect:347:10)
(Same with node -p '...')
Sorry, something went wrong.
There was a problem hiding this comment.
LGTM
Sorry, something went wrong.
|
It does not fix: #41244 I removed that from the description above. I have a fix for that and am going to open a PR later on. |
Sorry, something went wrong.
|
@bnoordhuis The below reproduces the reported behavior (v18.4.0) for the same reason. util.inspect({
a: {
get [Symbol.iterator]() {
throw Error('boom');
},
},
});> util.inspect({a:{get [Symbol.iterator](){ throw Error("boom") }}})
Uncaught Error [ERR_INTERNAL_ASSERTION]: Error: boom
at get [Symbol.iterator] (REPL2:1:49)
at formatRaw (node:internal/util/inspect:862:12)
at formatValue (node:internal/util/inspect:822:10)
at formatProperty (node:internal/util/inspect:1824:11)
at formatRaw (node:internal/util/inspect:1035:9)
at formatValue (node:internal/util/inspect:822:10)
at Object.inspect (node:internal/util/inspect:347:10)
at REPL2:1:6
at Script.runInThisContext (node:vm:130:12)
at REPLServer.defaultEval (node:repl:574:29)
This is caused by either a bug in Node.js or incorrect usage of Node.js internals.
Please open an issue with this stack trace at https://github.com/nodejs/node/issues
at __node_internal_captureLargerStackTrace (node:internal/errors:477:5)
at new NodeError (node:internal/errors:388:5)
at Function.fail (node:internal/assert:20:9)
at handleMaxCallStackSize (node:internal/util/inspect:1464:10)
at formatRaw (node:internal/util/inspect:1042:12)
at formatValue (node:internal/util/inspect:822:10)
at Object.inspect (node:internal/util/inspect:347:10) {
code: 'ERR_INTERNAL_ASSERTION'
}
|
Sorry, something went wrong.
|
Maybe I'm misunderstanding the cause, but anyway @BridgeAR, thanks for the confirmation. |
Sorry, something went wrong.
|
@cola119 it is one possibility to trigger the issue. There are other ways to trigger the internal error as well. |
Sorry, something went wrong.
Sorry, something went wrong.
Sorry, something went wrong.
Sorry, something went wrong.
PR-URL: #43683 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Darshan Sen <raisinten@gmail.com>
PR-URL: #43683 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Darshan Sen <raisinten@gmail.com>
PR-URL: #43683 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Darshan Sen <raisinten@gmail.com>
PR-URL: nodejs/node#43683 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Darshan Sen <raisinten@gmail.com>
| Back | FazBrowse Home | New Git URL |
Currently util.inspect has the inline access to Symbol.iterator to check if the value to be inspected is an iterator, but it could throw when the value of [Symbol.iterator] throws(has) an error.
This PR replaced the inline access with in operator to be able to inspect correctly.