@lvce-editor/test-with-playwright-worker 14.4.0 → 14.5.0
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/dist/workerMain.js +33 -34
- package/package.json +1 -1
package/dist/workerMain.js
CHANGED
|
@@ -422,12 +422,12 @@ const getErrorConstructor = (message, type) => {
|
|
|
422
422
|
switch (type) {
|
|
423
423
|
case DomException:
|
|
424
424
|
return DOMException;
|
|
425
|
-
case TypeError$1:
|
|
426
|
-
return TypeError;
|
|
427
|
-
case SyntaxError$1:
|
|
428
|
-
return SyntaxError;
|
|
429
425
|
case ReferenceError$1:
|
|
430
426
|
return ReferenceError;
|
|
427
|
+
case SyntaxError$1:
|
|
428
|
+
return SyntaxError;
|
|
429
|
+
case TypeError$1:
|
|
430
|
+
return TypeError;
|
|
431
431
|
default:
|
|
432
432
|
return Error;
|
|
433
433
|
}
|
|
@@ -583,27 +583,27 @@ const getErrorProperty = (error, prettyError) => {
|
|
|
583
583
|
if (error && error.code === E_COMMAND_NOT_FOUND) {
|
|
584
584
|
return {
|
|
585
585
|
code: MethodNotFound,
|
|
586
|
-
|
|
587
|
-
|
|
586
|
+
data: error.stack,
|
|
587
|
+
message: error.message
|
|
588
588
|
};
|
|
589
589
|
}
|
|
590
590
|
return {
|
|
591
591
|
code: Custom,
|
|
592
|
-
message: prettyError.message,
|
|
593
592
|
data: {
|
|
594
|
-
stack: getStack(prettyError),
|
|
595
|
-
codeFrame: prettyError.codeFrame,
|
|
596
|
-
type: getErrorType(prettyError),
|
|
597
593
|
code: prettyError.code,
|
|
598
|
-
|
|
599
|
-
|
|
594
|
+
codeFrame: prettyError.codeFrame,
|
|
595
|
+
name: prettyError.name,
|
|
596
|
+
stack: getStack(prettyError),
|
|
597
|
+
type: getErrorType(prettyError)
|
|
598
|
+
},
|
|
599
|
+
message: prettyError.message
|
|
600
600
|
};
|
|
601
601
|
};
|
|
602
602
|
const create$1$1 = (id, error) => {
|
|
603
603
|
return {
|
|
604
|
-
|
|
604
|
+
error,
|
|
605
605
|
id,
|
|
606
|
-
|
|
606
|
+
jsonrpc: Two$1
|
|
607
607
|
};
|
|
608
608
|
};
|
|
609
609
|
const getErrorResponse = (id, error, preparePrettyError, logError) => {
|
|
@@ -614,8 +614,8 @@ const getErrorResponse = (id, error, preparePrettyError, logError) => {
|
|
|
614
614
|
};
|
|
615
615
|
const create$4 = (message, result) => {
|
|
616
616
|
return {
|
|
617
|
-
jsonrpc: Two$1,
|
|
618
617
|
id: message.id,
|
|
618
|
+
jsonrpc: Two$1,
|
|
619
619
|
result: result ?? null
|
|
620
620
|
};
|
|
621
621
|
};
|
|
@@ -625,14 +625,14 @@ const getSuccessResponse = (message, result) => {
|
|
|
625
625
|
};
|
|
626
626
|
const getErrorResponseSimple = (id, error) => {
|
|
627
627
|
return {
|
|
628
|
-
jsonrpc: Two$1,
|
|
629
|
-
id,
|
|
630
628
|
error: {
|
|
631
629
|
code: Custom,
|
|
630
|
+
data: error,
|
|
632
631
|
// @ts-ignore
|
|
633
|
-
message: error.message
|
|
634
|
-
|
|
635
|
-
|
|
632
|
+
message: error.message
|
|
633
|
+
},
|
|
634
|
+
id,
|
|
635
|
+
jsonrpc: Two$1
|
|
636
636
|
};
|
|
637
637
|
};
|
|
638
638
|
const getResponse = async (message, ipc, execute, preparePrettyError, logError, requiresSocket) => {
|
|
@@ -662,35 +662,35 @@ const normalizeParams = args => {
|
|
|
662
662
|
if (args.length === 1) {
|
|
663
663
|
const options = args[0];
|
|
664
664
|
return {
|
|
665
|
+
execute: options.execute,
|
|
665
666
|
ipc: options.ipc,
|
|
667
|
+
logError: options.logError || defaultLogError,
|
|
666
668
|
message: options.message,
|
|
667
|
-
execute: options.execute,
|
|
668
|
-
resolve: options.resolve || defaultResolve,
|
|
669
669
|
preparePrettyError: options.preparePrettyError || defaultPreparePrettyError,
|
|
670
|
-
|
|
671
|
-
|
|
670
|
+
requiresSocket: options.requiresSocket || defaultRequiresSocket,
|
|
671
|
+
resolve: options.resolve || defaultResolve
|
|
672
672
|
};
|
|
673
673
|
}
|
|
674
674
|
return {
|
|
675
|
+
execute: args[2],
|
|
675
676
|
ipc: args[0],
|
|
677
|
+
logError: args[5],
|
|
676
678
|
message: args[1],
|
|
677
|
-
execute: args[2],
|
|
678
|
-
resolve: args[3],
|
|
679
679
|
preparePrettyError: args[4],
|
|
680
|
-
|
|
681
|
-
|
|
680
|
+
requiresSocket: args[6],
|
|
681
|
+
resolve: args[3]
|
|
682
682
|
};
|
|
683
683
|
};
|
|
684
684
|
const handleJsonRpcMessage = async (...args) => {
|
|
685
685
|
const options = normalizeParams(args);
|
|
686
686
|
const {
|
|
687
|
-
message,
|
|
688
|
-
ipc,
|
|
689
687
|
execute,
|
|
690
|
-
|
|
691
|
-
preparePrettyError,
|
|
688
|
+
ipc,
|
|
692
689
|
logError,
|
|
693
|
-
|
|
690
|
+
message,
|
|
691
|
+
preparePrettyError,
|
|
692
|
+
requiresSocket,
|
|
693
|
+
resolve
|
|
694
694
|
} = options;
|
|
695
695
|
if ('id' in message) {
|
|
696
696
|
if ('method' in message) {
|
|
@@ -751,7 +751,6 @@ const registerPromise = map => {
|
|
|
751
751
|
};
|
|
752
752
|
};
|
|
753
753
|
|
|
754
|
-
// @ts-ignore
|
|
755
754
|
const invokeHelper = async (callbacks, ipc, method, params, useSendAndTransfer) => {
|
|
756
755
|
const {
|
|
757
756
|
id,
|