src: add a flag to keep the embedder's wasm streaming callback · nodejs/node@d7c720f · GitHub
Skip to content

Commit d7c720f

Browse files
codebytereaduh95
authored andcommitted
src: add a flag to keep the embedder's wasm streaming callback
`SetIsolateMiscHandlers()` always installs Node.js's `WebAssembly.compileStreaming()` implementation, which is backed by the Environment's fetch-based handler. An embedder that provides its own streaming callback (for example one wired to its own network stack) has to re-install it after every `SetIsolateUpForNode()` or `NewIsolate()` call. Add `SHOULD_NOT_SET_WASM_STREAMING_CALLBACK` next to the existing `SHOULD_NOT_SET_PROMISE_REJECTION_CALLBACK` and `SHOULD_NOT_SET_PREPARE_STACK_TRACE_CALLBACK` flags so it can opt out the same way. Refs: #36447 Signed-off-by: Shelley Vohr <shelley.vohr@gmail.com> PR-URL: #65690 Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
1 parent 7c9b2df commit d7c720f

3 files changed

Lines changed: 37 additions & 1 deletion

File tree

‎src/api/environment.cc‎

Lines changed: 3 additions & 1 deletion

‎src/node.h‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -427,6 +427,7 @@ enum IsolateSettingsFlags {
427427
DETAILED_SOURCE_POSITIONS_FOR_PROFILING = 1 << 1,
428428
SHOULD_NOT_SET_PROMISE_REJECTION_CALLBACK = 1 << 2,
429429
SHOULD_NOT_SET_PREPARE_STACK_TRACE_CALLBACK = 1 << 3,
430+
SHOULD_NOT_SET_WASM_STREAMING_CALLBACK = 1 << 4,
430431
ALLOW_MODIFY_CODE_GENERATION_FROM_STRINGS_CALLBACK = 0, /* legacy no-op */
431432
};
432433

‎test/cctest/test_environment.cc‎

Lines changed: 33 additions & 0 deletions

0 commit comments

Comments
 (0)