Some console methods are created by the V8 inspector after an inspector client is created, reset them to undefined during sereialization to avoid holding on to invalid references in the snapshot. V8 will take care of the re-initialization when another inspector client is created during deserialization. PR-URL: https://github.com/nodejs/node/pull/44279 Fixes: https://github.com/nodejs/node-v8/issues/237 Reviewed-By: Chengzhong Wu <legendecas@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
9 lines
236 B
JavaScript
9 lines
236 B
JavaScript
const {
|
|
setDeserializeMainFunction,
|
|
} = require('v8').startupSnapshot;
|
|
|
|
console.log(JSON.stringify(Object.keys(console), null, 2));
|
|
|
|
setDeserializeMainFunction(() => {
|
|
console.log(JSON.stringify(Object.keys(console), null, 2));
|
|
});
|