зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1613974 - Fix transfer-errors.window.js WPT failures, r=ttung,sfink
Differential Revision: https://phabricator.services.mozilla.com/D62056 --HG-- extra : moz-landing-system : lando
This commit is contained in:
Родитель
c508a968ca
Коммит
5419708e2a
|
@ -701,6 +701,8 @@ class JS_PUBLIC_API JSAutoStructuredCloneBuffer {
|
|||
#define JS_SCERR_DUP_TRANSFERABLE 2
|
||||
#define JS_SCERR_UNSUPPORTED_TYPE 3
|
||||
#define JS_SCERR_SHMEM_TRANSFERABLE 4
|
||||
#define JS_SCERR_TYPED_ARRAY_DETACHED 5
|
||||
#define JS_SCERR_WASM_NO_TRANSFER 6
|
||||
|
||||
JS_PUBLIC_API bool JS_ReadUint32Pair(JSStructuredCloneReader* r, uint32_t* p1,
|
||||
uint32_t* p2);
|
||||
|
|
|
@ -617,6 +617,16 @@ static void ReportDataCloneError(JSContext* cx,
|
|||
JSMSG_SC_SHMEM_TRANSFERABLE);
|
||||
break;
|
||||
|
||||
case JS_SCERR_TYPED_ARRAY_DETACHED:
|
||||
JS_ReportErrorNumberASCII(cx, GetErrorMessage, nullptr,
|
||||
JSMSG_TYPED_ARRAY_DETACHED);
|
||||
break;
|
||||
|
||||
case JS_SCERR_WASM_NO_TRANSFER:
|
||||
JS_ReportErrorNumberASCII(cx, GetErrorMessage, nullptr,
|
||||
JSMSG_WASM_NO_TRANSFER);
|
||||
break;
|
||||
|
||||
default:
|
||||
MOZ_CRASH("Unkown errorId");
|
||||
break;
|
||||
|
@ -1866,14 +1876,12 @@ bool JSStructuredCloneWriter::transferOwnership() {
|
|||
JSAutoRealm ar(cx, arrayBuffer);
|
||||
|
||||
if (arrayBuffer->isDetached()) {
|
||||
JS_ReportErrorNumberASCII(cx, GetErrorMessage, nullptr,
|
||||
JSMSG_TYPED_ARRAY_DETACHED);
|
||||
reportDataCloneError(JS_SCERR_TYPED_ARRAY_DETACHED);
|
||||
return false;
|
||||
}
|
||||
|
||||
if (arrayBuffer->isPreparedForAsmJS()) {
|
||||
JS_ReportErrorNumberASCII(cx, GetErrorMessage, nullptr,
|
||||
JSMSG_WASM_NO_TRANSFER);
|
||||
reportDataCloneError(JS_SCERR_WASM_NO_TRANSFER);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,10 +1,4 @@
|
|||
[transfer-errors.window.html]
|
||||
[Serialize should make the ArrayBuffer detached, so it cannot be transferred again]
|
||||
expected: FAIL
|
||||
|
||||
[Cannot transfer ArrayBuffer detached while the message was serialized]
|
||||
expected: FAIL
|
||||
|
||||
[Cannot transfer the same OffscreenCanvas twice]
|
||||
expected: FAIL
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче