promise-worker-bi 5.0.0 → 5.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/index.js +8 -4
- package/dist/test/test.js +1838 -0
- package/dist/test/worker-bidirectional-echo.js +1180 -0
- package/dist/test/worker-echo-custom-2.js +265 -0
- package/dist/test/worker-echo-custom.js +265 -0
- package/dist/test/worker-echo.js +258 -0
- package/dist/test/worker-empty.js +257 -0
- package/dist/test/worker-error-async.js +260 -0
- package/dist/test/worker-error-sync.js +258 -0
- package/dist/test/worker-host-echo-custom.js +1194 -0
- package/dist/test/worker-host-echo-multiple.js +1193 -0
- package/dist/test/worker-host-echo.js +1175 -0
- package/dist/test/worker-host-empty.js +1183 -0
- package/dist/test/worker-host-error-async.js +1180 -0
- package/dist/test/worker-host-error-outside-response.js +260 -0
- package/dist/test/worker-host-error-sync.js +1180 -0
- package/dist/test/worker-host-ping.js +1175 -0
- package/dist/test/worker-host-transferable.js +1185 -0
- package/dist/test/worker-hostid.js +259 -0
- package/dist/test/worker-pong-promise.js +258 -0
- package/dist/test/worker-pong.js +258 -0
- package/dist/test/worker-shared.js +266 -0
- package/dist/test/worker-transferable.js +1188 -0
- package/package.json +2 -3
package/README.md
CHANGED
package/dist/index.js
CHANGED
|
@@ -238,8 +238,10 @@ class PWBHost extends PWBBase {
|
|
|
238
238
|
if (!common) {
|
|
239
239
|
return;
|
|
240
240
|
}
|
|
241
|
-
const
|
|
242
|
-
|
|
241
|
+
const {
|
|
242
|
+
message,
|
|
243
|
+
type
|
|
244
|
+
} = common;
|
|
243
245
|
if (type === MSGTYPE_HOST_ID) {
|
|
244
246
|
if (message[2] !== undefined && typeof message[2] !== "number") {
|
|
245
247
|
throw new Error("Invalid hostID");
|
|
@@ -358,8 +360,10 @@ class PWBWorker extends PWBBase {
|
|
|
358
360
|
if (!common) {
|
|
359
361
|
return;
|
|
360
362
|
}
|
|
361
|
-
const
|
|
362
|
-
|
|
363
|
+
const {
|
|
364
|
+
message,
|
|
365
|
+
type
|
|
366
|
+
} = common;
|
|
363
367
|
if (type === MSGTYPE_HOST_CLOSE) {
|
|
364
368
|
if (typeof message[2] !== "number") {
|
|
365
369
|
throw new Error("Invalid hostID");
|