| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 352a600 commit 070ee4b
3 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -714,6 +714,12 @@ Used when a child process is being forked without specifying an IPC channel. | |||
| 714 | 714 | Used when the main process is trying to read data from the child process's | |
| 715 | 715 | STDERR/STDOUT, and the data's length is longer than the `maxBuffer` option. | |
| 716 | 716 | ||
| 717 | + <a id="ERR_CLOSED_MESSAGE_PORT"></a> | ||
| 718 | + ### ERR_CLOSED_MESSAGE_PORT | ||
| 719 | + | ||
| 720 | + There was an attempt to use a `MessagePort` instance in a closed | ||
| 721 | + state, usually after `.close()` has been called. | ||
| 722 | + | ||
| 717 | 723 | <a id="ERR_CONSOLE_WRITABLE_STREAM"></a> | |
| 718 | 724 | ### `ERR_CONSOLE_WRITABLE_STREAM` | |
| 719 | 725 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -32,6 +32,7 @@ void OnFatalError(const char* location, const char* message); | |||
| 32 | 32 | V(ERR_BUFFER_CONTEXT_NOT_AVAILABLE, Error) \ | |
| 33 | 33 | V(ERR_BUFFER_OUT_OF_BOUNDS, RangeError) \ | |
| 34 | 34 | V(ERR_BUFFER_TOO_LARGE, Error) \ | |
| 35 | + V(ERR_CLOSED_MESSAGE_PORT, Error) \ | ||
| 35 | 36 | V(ERR_CONSTRUCT_CALL_REQUIRED, TypeError) \ | |
| 36 | 37 | V(ERR_CONSTRUCT_CALL_INVALID, TypeError) \ | |
| 37 | 38 | V(ERR_CRYPTO_INITIALIZATION_FAILED, Error) \ | |
@@ -118,6 +119,7 @@ ERRORS_WITH_CODE(V) | |||
| 118 | 119 | #define PREDEFINED_ERROR_MESSAGES(V) \ | |
| 119 | 120 | V(ERR_BUFFER_CONTEXT_NOT_AVAILABLE, \ | |
| 120 | 121 | "Buffer is not available for the current Context") \ | |
| 122 | + V(ERR_CLOSED_MESSAGE_PORT, "Cannot send data on closed MessagePort") \ | ||
| 121 | 123 | V(ERR_CONSTRUCT_CALL_INVALID, "Constructor cannot be called") \ | |
| 122 | 124 | V(ERR_CONSTRUCT_CALL_REQUIRED, "Cannot call constructor without `new`") \ | |
| 123 | 125 | V(ERR_CRYPTO_INITIALIZATION_FAILED, "Initialization failed") \ | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1065,7 +1065,11 @@ void MessagePort::MoveToContext(const FunctionCallbackInfo<Value>& args) { | |||
| 1065 | 1065 | "The \"port\" argument must be a MessagePort instance"); | |
| 1066 | 1066 | } | |
| 1067 | 1067 | MessagePort* port = Unwrap<MessagePort>(args[0].As<Object>()); | |
| 1068 | - CHECK_NOT_NULL(port); | ||
| 1068 | + if (port == nullptr || port->IsHandleClosing()) { | ||
| 1069 | + Isolate* isolate = env->isolate(); | ||
| 1070 | + THROW_ERR_CLOSED_MESSAGE_PORT(isolate); | ||
| 1071 | + return; | ||
| 1072 | + } | ||
| 1069 | 1073 | ||
| 1070 | 1074 | Local<Value> context_arg = args[1]; | |
| 1071 | 1075 | ContextifyContext* context_wrapper; | |
| Back | FazBrowse Home | New Git URL |
0 commit comments