| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
|
My original implementation didn't take into account that GeneratorFunction.prototype.next is user-mutable – and therefore wasn't any safer. I took another approach which is hopefully safe this time, but I might have missed something else, please review. Note that I'm using ._iterator instead of .#iterator based on #36326 (comment); the SafeIterator class is internal-only anyway and should never be accessible to user-land, I don't think the actual visibility of the field matters at all. We could use a Symbol if anyone prefers. |
Sorry, something went wrong.
|
@addaleax This change affects code running during Worker termination, you may want to review this. I tried to be extra careful, but I may have missed something somewhere. |
Sorry, something went wrong.
git blame points at you for this warning added in f17e414: node/lib/internal/source_map/source_map_cache.js Lines 183 to 186 in cf53748 |
Sorry, something went wrong.
|
Can we add a test for the edge case this fixes? |
Sorry, something went wrong.
@Trott Good call, the added test highlighted a bug which provides a way for workers to get out of worker.terminate(). |
Sorry, something went wrong.
PR-URL: #36391 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
|
Backporting this to v12.x would be nice as it fixes a potential bug with the Worker implementation, but backporters would have to remove use of null coalescing operator. |
Sorry, something went wrong.
PR-URL: #36391 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
|
This lands cleanly on v14.x but then it fails to build. |
Sorry, something went wrong.
PR-URL: nodejs#36391 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
| Back | FazBrowse Home | New Git URL |
MapIterator and SetIterator are user-mutable, I think it makes sense to be able to iterate over SafeMap and SafeSet without calling possibly-user-mutated code.
Note that patterns such as for (const [key, value] of safeMap) would still be potentially "unsafe" as it executes %ArrayIteratorPrototype%.next when destructuring, which may have been mutated in user-land.
Checklist