diff options
author | Anna Henningsen <anna@addaleax.net> | 2019-06-02 19:42:22 +0200 |
---|---|---|
committer | Rich Trott <rtrott@gmail.com> | 2019-06-12 20:56:44 -0700 |
commit | 0640526303bbe9c41801e2ad795f9cccb29f1fa4 (patch) | |
tree | 155a1027bf9b28de666f10b756a3c53257988414 /src/node_messaging.h | |
parent | 25399e4c9cea290e0bb061b0208cb4e9e5e17642 (diff) | |
download | android-node-v8-0640526303bbe9c41801e2ad795f9cccb29f1fa4.tar.gz android-node-v8-0640526303bbe9c41801e2ad795f9cccb29f1fa4.tar.bz2 android-node-v8-0640526303bbe9c41801e2ad795f9cccb29f1fa4.zip |
worker: make MessagePort constructor non-callable
Refactor the C++ code for creating `MessagePort`s to skip calling the
constructor and instead directly instantiating the `InstanceTemplate`,
and always throw an error from the `MessagePort` constructor.
This aligns behaviour with the web, and creating single `MessagePort`s
does not make sense anyway.
PR-URL: https://github.com/nodejs/node/pull/28032
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Diffstat (limited to 'src/node_messaging.h')
-rw-r--r-- | src/node_messaging.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/node_messaging.h b/src/node_messaging.h index 9f7929aa1c..d9f25a95d7 100644 --- a/src/node_messaging.h +++ b/src/node_messaging.h @@ -211,8 +211,8 @@ class MessagePort : public HandleWrap { friend class MessagePortData; }; -v8::MaybeLocal<v8::Function> GetMessagePortConstructor( - Environment* env, v8::Local<v8::Context> context); +v8::Local<v8::FunctionTemplate> GetMessagePortConstructorTemplate( + Environment* env); } // namespace worker } // namespace node |