Skip to content

Commit 1dc78b2

Browse files
addaleaxcodebytere
authored andcommitted
src: remove preview for heap dump utilities
At least `createHeapSnapshotStream()` and `triggerHeapSnapshot()` do have side effects, and more importantly, they should not be run transparently. Without this, typing e.g. `v8.getHeapSnapshot()` into the REPL will result in a crash or infinite loop while the REPL evaluates the expression for a preview. PR-URL: #31570 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: David Carlier <devnexen@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
1 parent a07880f commit 1dc78b2

File tree

1 file changed

+3
-9
lines changed

1 file changed

+3
-9
lines changed

src/heap_utils.cc

+3-9
Original file line numberDiff line numberDiff line change
@@ -385,15 +385,9 @@ void Initialize(Local<Object> target,
385385
void* priv) {
386386
Environment* env = Environment::GetCurrent(context);
387387

388-
env->SetMethodNoSideEffect(target,
389-
"buildEmbedderGraph",
390-
BuildEmbedderGraph);
391-
env->SetMethodNoSideEffect(target,
392-
"triggerHeapSnapshot",
393-
TriggerHeapSnapshot);
394-
env->SetMethodNoSideEffect(target,
395-
"createHeapSnapshotStream",
396-
CreateHeapSnapshotStream);
388+
env->SetMethod(target, "buildEmbedderGraph", BuildEmbedderGraph);
389+
env->SetMethod(target, "triggerHeapSnapshot", TriggerHeapSnapshot);
390+
env->SetMethod(target, "createHeapSnapshotStream", CreateHeapSnapshotStream);
397391

398392
// Create FunctionTemplate for HeapSnapshotStream
399393
Local<FunctionTemplate> os = FunctionTemplate::New(env->isolate());

0 commit comments

Comments
 (0)