When a V8 ScriptHost is closed, it is returned to a pool of isolates, optimizing construction of new isolates. However is code holds on to the ScriptHost, it could lead to a use-after-free bug.
Consider returning a proxy, whose implementation pointer is reset to nil after closing.
Same issue could be applied to other script engines, if they cache script hosts.
When a V8 ScriptHost is closed, it is returned to a pool of isolates, optimizing construction of new isolates. However is code holds on to the ScriptHost, it could lead to a use-after-free bug.
Consider returning a proxy, whose implementation pointer is reset to nil after closing.
Same issue could be applied to other script engines, if they cache script hosts.