Skip to content

Commit 3812fd5

Browse files
authored
deps: Update to latest StarlingMonkey (#1122)
1 parent 5c2e7e0 commit 3812fd5

File tree

13 files changed

+142
-27
lines changed

13 files changed

+142
-27
lines changed

runtime/StarlingMonkey

Submodule StarlingMonkey updated 137 files

runtime/fastly/builtins/fetch/request-response.cpp

+7-24
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@
3636

3737
using builtins::web::base64::valueToJSByteString;
3838
using builtins::web::blob::Blob;
39-
using builtins::web::blob::BlobReader;
4039
using builtins::web::dom_exception::DOMException;
4140

4241
// We use the StarlingMonkey Headers implementation, despite it supporting features that we do
@@ -792,38 +791,22 @@ bool RequestOrResponse::extract_body(JSContext *cx, JS::HandleObject self,
792791
host_api::HostString host_type_str;
793792

794793
if (Blob::is_instance(body_obj)) {
795-
auto native_stream = NativeStreamSource::create(cx, body_obj, JS::UndefinedHandleValue,
796-
Blob::stream_pull, Blob::stream_cancel);
797-
if (!native_stream) {
794+
RootedValue stream(cx);
795+
if (!Blob::stream(cx, body_obj, &stream)) {
798796
return false;
799797
}
800798

801-
JS::RootedObject source(cx, native_stream);
802-
if (!source) {
803-
return false;
804-
}
805-
806-
auto readers = Blob::readers(body_obj);
807-
auto blob = Blob::blob(body_obj);
808-
auto span = std::span<uint8_t>(blob->begin(), blob->length());
809-
810-
if (!readers->put(source, BlobReader(span))) {
811-
return false;
812-
}
813-
814-
JS::RootedObject stream(cx, NativeStreamSource::stream(native_stream));
815-
if (!stream) {
816-
return false;
817-
}
799+
MOZ_ASSERT(stream.isObject());
800+
JS_SetReservedSlot(self, static_cast<uint32_t>(RequestOrResponse::Slots::BodyStream), stream);
818801

819-
JS_SetReservedSlot(self, static_cast<uint32_t>(RequestOrResponse::Slots::BodyStream),
820-
JS::ObjectValue(*stream));
802+
// TODO: Set content-length header from known body extracted size
803+
// size_t content_length = Blob::blob_size(body_obj);
821804

822805
JS::RootedString type_str(cx, Blob::type(body_obj));
823806
if (JS::GetStringLength(type_str) > 0) {
824807
host_type_str = core::encode(cx, type_str);
825808
MOZ_ASSERT(host_type_str);
826-
content_type = host_type_str.ptr.get();
809+
content_type = host_type_str.begin();
827810
}
828811
} else if (body_obj && JS::IsReadableStream(body_obj)) {
829812
if (RequestOrResponse::body_unusable(cx, body_obj)) {

tests/wpt-harness/expectations/WebCryptoAPI/digest/digest.https.any.js.json

+12
Original file line numberDiff line numberDiff line change
@@ -238,5 +238,17 @@
238238
},
239239
"AES-KW with long": {
240240
"status": "PASS"
241+
},
242+
"empty algorithm object with empty": {
243+
"status": "FAIL"
244+
},
245+
"empty algorithm object with short": {
246+
"status": "FAIL"
247+
},
248+
"empty algorithm object with medium": {
249+
"status": "FAIL"
250+
},
251+
"empty algorithm object with long": {
252+
"status": "FAIL"
241253
}
242254
}

tests/wpt-harness/expectations/streams/readable-byte-streams/general.any.js.json

+6
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,9 @@
4444
"ReadableStream with byte source: Test that erroring a stream does not release a BYOB reader automatically": {
4545
"status": "PASS"
4646
},
47+
"ReadableStream with byte source: cannot use an already-released BYOB reader to unlock a stream again": {
48+
"status": "PASS"
49+
},
4750
"ReadableStream with byte source: releaseLock() on ReadableStreamDefaultReader must reject pending read()": {
4851
"status": "PASS"
4952
},
@@ -107,6 +110,9 @@
107110
"ReadableStream with byte source: respond(3) to read(view) with 2 element Uint16Array enqueues the 1 byte remainder": {
108111
"status": "PASS"
109112
},
113+
"ReadableStream with byte source: respond(3) to read(view) with 2 element Uint16Array fulfills second read(view) with the 1 byte remainder": {
114+
"status": "PASS"
115+
},
110116
"ReadableStream with byte source: enqueue(), getReader(), then read(view)": {
111117
"status": "PASS"
112118
},

tests/wpt-harness/expectations/streams/readable-streams/from.any.js.json

+27
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,12 @@
7171
"ReadableStream.from throws on invalid iterables; specifically an object with a non-callable @@asyncIterator method": {
7272
"status": "PASS"
7373
},
74+
"ReadableStream.from throws on invalid iterables; specifically an object with an @@iterator method returning a non-object": {
75+
"status": "PASS"
76+
},
77+
"ReadableStream.from throws on invalid iterables; specifically an object with an @@asyncIterator method returning a non-object": {
78+
"status": "PASS"
79+
},
7480
"ReadableStream.from re-throws errors from calling the @@iterator method": {
7581
"status": "FAIL"
7682
},
@@ -89,6 +95,15 @@
8995
"ReadableStream.from: stream errors when next() rejects": {
9096
"status": "FAIL"
9197
},
98+
"ReadableStream.from: stream errors when next() throws synchronously": {
99+
"status": "FAIL"
100+
},
101+
"ReadableStream.from: stream errors when next() returns a non-object": {
102+
"status": "FAIL"
103+
},
104+
"ReadableStream.from: stream errors when next() fulfills with a non-object": {
105+
"status": "FAIL"
106+
},
92107
"ReadableStream.from: stream stalls when next() never settles": {
93108
"status": "FAIL"
94109
},
@@ -101,6 +116,18 @@
101116
"ReadableStream.from: return() is not called when iterator completes normally": {
102117
"status": "FAIL"
103118
},
119+
"ReadableStream.from: cancel() resolves when return() method is missing": {
120+
"status": "FAIL"
121+
},
122+
"ReadableStream.from: cancel() rejects when return() is not a method": {
123+
"status": "FAIL"
124+
},
125+
"ReadableStream.from: cancel() rejects when return() rejects": {
126+
"status": "FAIL"
127+
},
128+
"ReadableStream.from: cancel() rejects when return() throws synchronously": {
129+
"status": "FAIL"
130+
},
104131
"ReadableStream.from: cancel() rejects when return() fulfills with a non-object": {
105132
"status": "FAIL"
106133
},

tests/wpt-harness/expectations/streams/readable-streams/garbage-collection.any.js.json

+3
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,8 @@
1010
},
1111
"Garbage-collecting a ReadableStreamDefaultReader should not unlock its stream": {
1212
"status": "PASS"
13+
},
14+
"A ReadableStream and its reader should not be garbage collected while there is a read promise pending": {
15+
"status": "PASS"
1316
}
1417
}

tests/wpt-harness/expectations/streams/readable-streams/templated.any.js.json

+15
Original file line numberDiff line numberDiff line change
@@ -256,5 +256,20 @@
256256
},
257257
"ReadableStream (two chunks enqueued, then closed) reader: reader's closed property always returns the same promise": {
258258
"status": "PASS"
259+
},
260+
"Running templatedRSThrowAfterCloseOrError with ReadableStream": {
261+
"status": "PASS"
262+
},
263+
"ReadableStream: enqueue() throws after close()": {
264+
"status": "PASS"
265+
},
266+
"ReadableStream: enqueue() throws after enqueue() and close()": {
267+
"status": "PASS"
268+
},
269+
"ReadableStream: enqueue() throws after error()": {
270+
"status": "PASS"
271+
},
272+
"ReadableStream: close() throws after error()": {
273+
"status": "PASS"
259274
}
260275
}

tests/wpt-harness/expectations/streams/transform-streams/cancel.any.js.json

+12
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,17 @@
1919
},
2020
"writable.abort() and readable.cancel() should reject if a transformer.cancel() calls controller.error()": {
2121
"status": "FAIL"
22+
},
23+
"readable.cancel() should not call cancel() when flush() is already called from writable.close()": {
24+
"status": "PASS"
25+
},
26+
"readable.cancel() should not call cancel() again when already called from writable.abort()": {
27+
"status": "FAIL"
28+
},
29+
"writable.close() should not call flush() when cancel() is already called from readable.cancel()": {
30+
"status": "FAIL"
31+
},
32+
"writable.abort() should not call cancel() again when already called from readable.cancel()": {
33+
"status": "FAIL"
2234
}
2335
}

tests/wpt-harness/expectations/streams/writable-streams/aborting.any.js.json

+10-1
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,16 @@
182182
"the abort signal is not signalled on close failure": {
183183
"status": "FAIL"
184184
},
185-
"recursive abort() call": {
185+
"recursive abort() call from abort() aborting signal (not started)": {
186+
"status": "FAIL"
187+
},
188+
"recursive abort() call from abort() aborting signal": {
189+
"status": "FAIL"
190+
},
191+
"recursive close() call from abort() aborting signal (not started)": {
192+
"status": "FAIL"
193+
},
194+
"recursive close() call from abort() aborting signal": {
186195
"status": "FAIL"
187196
}
188197
}

tests/wpt-harness/expectations/streams/writable-streams/constructor.any.js.json

+3
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@
1717
"WritableStream should be constructible with no arguments": {
1818
"status": "PASS"
1919
},
20+
"WritableStream can't be constructed with a defined type": {
21+
"status": "PASS"
22+
},
2023
"underlyingSink argument should be converted after queuingStrategy argument": {
2124
"status": "PASS"
2225
},

tests/wpt-harness/expectations/url/url-constructor.any.js.json

+24
Original file line numberDiff line numberDiff line change
@@ -668,6 +668,9 @@
668668
"Parsing: <mailto:example.com/> without base": {
669669
"status": "PASS"
670670
},
671+
"Parsing: <https://example.com/aaa/bbb/%2e%2e?query> without base": {
672+
"status": "PASS"
673+
},
671674
"Parsing: <http:@www.example.com> without base": {
672675
"status": "PASS"
673676
},
@@ -2558,6 +2561,27 @@
25582561
"Parsing: <//a/../> against <file:///>": {
25592562
"status": "PASS"
25602563
},
2564+
"Parsing: <non-special:\\\\opaque> without base": {
2565+
"status": "PASS"
2566+
},
2567+
"Parsing: <non-special:\\\\opaque/path> without base": {
2568+
"status": "PASS"
2569+
},
2570+
"Parsing: <non-special:\\\\opaque\\path> without base": {
2571+
"status": "PASS"
2572+
},
2573+
"Parsing: <non-special:\\/opaque> without base": {
2574+
"status": "PASS"
2575+
},
2576+
"Parsing: <non-special:/\\path> without base": {
2577+
"status": "PASS"
2578+
},
2579+
"Parsing: <non-special://host\\a> without base": {
2580+
"status": "PASS"
2581+
},
2582+
"Parsing: <non-special://host/a\\b> without base": {
2583+
"status": "PASS"
2584+
},
25612585
"Parsing: <http://example.com/U+d800𐟾U+dfff﷐﷏﷯ﷰ￾￿?U+d800𐟾U+dfff﷐﷏﷯ﷰ￾￿> without base": {
25622586
"status": "PASS"
25632587
}

tests/wpt-harness/expectations/url/url-origin.any.js.json

+21
Original file line numberDiff line numberDiff line change
@@ -536,6 +536,9 @@
536536
"Origin parsing: <mailto:example.com/> without base": {
537537
"status": "PASS"
538538
},
539+
"Origin parsing: <https://example.com/aaa/bbb/%2e%2e?query> without base": {
540+
"status": "PASS"
541+
},
539542
"Origin parsing: <http:@www.example.com> without base": {
540543
"status": "PASS"
541544
},
@@ -1133,6 +1136,24 @@
11331136
"Origin parsing: <isolated-app://x:0> without base": {
11341137
"status": "PASS"
11351138
},
1139+
"Origin parsing: <non-special:\\\\opaque> without base": {
1140+
"status": "PASS"
1141+
},
1142+
"Origin parsing: <non-special:\\\\opaque/path> without base": {
1143+
"status": "PASS"
1144+
},
1145+
"Origin parsing: <non-special:\\\\opaque\\path> without base": {
1146+
"status": "PASS"
1147+
},
1148+
"Origin parsing: <non-special:\\/opaque> without base": {
1149+
"status": "PASS"
1150+
},
1151+
"Origin parsing: <non-special:/\\path> without base": {
1152+
"status": "PASS"
1153+
},
1154+
"Origin parsing: <non-special://host/a\\b> without base": {
1155+
"status": "PASS"
1156+
},
11361157
"Origin parsing: <http://example.com/U+d800𐟾U+dfff﷐﷏﷯ﷰ￾￿?U+d800𐟾U+dfff﷐﷏﷯ﷰ￾￿> without base": {
11371158
"status": "PASS"
11381159
}

tests/wpt-harness/wpt

Submodule wpt updated 7369 files

0 commit comments

Comments
 (0)