Skip to content

Commit 1a9be1c

Browse files
authored
Update to SpiderMonkey 112 (#502)
1 parent 4b991a6 commit 1a9be1c

File tree

3 files changed

+8
-11
lines changed

3 files changed

+8
-11
lines changed

c-dependencies/js-compute-runtime/builtins/transform-stream.cpp

+5-3
Original file line numberDiff line numberDiff line change
@@ -146,8 +146,9 @@ bool pipeThrough(JSContext *cx, unsigned argc, JS::Value *vp) {
146146

147147
bool initialize_additions(JSContext *cx, JS::HandleObject global) {
148148
JS::RootedValue val(cx);
149-
if (!JS_GetProperty(cx, global, "ReadableStream", &val))
149+
if (!JS_GetProperty(cx, global, "ReadableStream", &val)) {
150150
return false;
151+
}
151152
JS::RootedObject readableStream_builtin(cx, &val.toObject());
152153

153154
if (!JS_GetProperty(cx, readableStream_builtin, "prototype", &val)) {
@@ -158,8 +159,9 @@ bool initialize_additions(JSContext *cx, JS::HandleObject global) {
158159

159160
original_pipeTo.init(cx);
160161
overridden_pipeTo.init(cx);
161-
if (!JS_GetProperty(cx, proto_obj, "pipeTo", &original_pipeTo))
162+
if (!JS_GetProperty(cx, proto_obj, "pipeTo", &original_pipeTo)) {
162163
return false;
164+
}
163165
MOZ_ASSERT(JS::IsCallable(&original_pipeTo.toObject()));
164166

165167
JSFunction *pipeTo_fun = JS_DefineFunction(cx, proto_obj, "pipeTo", pipeTo, 1, JSPROP_ENUMERATE);
@@ -222,7 +224,7 @@ bool ExtractStrategy(JSContext *cx, JS::HandleValue strategy, double default_hwm
222224
if (!JS::ToNumber(cx, val, hwm)) {
223225
return false;
224226
}
225-
if (mozilla::IsNaN(*hwm) || *hwm < 0) {
227+
if (std::isnan(*hwm) || *hwm < 0) {
226228
JS_ReportErrorLatin1(cx, "Invalid value for highWaterMark: %f", *hwm);
227229
return false;
228230
}

c-dependencies/js-compute-runtime/js-compute-runtime.cpp

+2-7
Original file line numberDiff line numberDiff line change
@@ -117,13 +117,8 @@ bool init_js() {
117117

118118
// TODO: check if we should set a different creation zone.
119119
JS::RealmOptions options;
120-
options.creationOptions()
121-
.setStreamsEnabled(true)
122-
.setReadableByteStreamsEnabled(true)
123-
.setBYOBStreamReadersEnabled(true)
124-
.setReadableStreamPipeToEnabled(true)
125-
.setWritableStreamsEnabled(true)
126-
.setWeakRefsEnabled(JS::WeakRefSpecifier::EnabledWithoutCleanupSome);
120+
options.creationOptions().setStreamsEnabled(true).setWeakRefsEnabled(
121+
JS::WeakRefSpecifier::EnabledWithoutCleanupSome);
127122

128123
JS::DisableIncrementalGC(cx);
129124
// JS_SetGCParameter(cx, JSGC_MAX_EMPTY_CHUNK_COUNT, 1);

c-dependencies/spidermonkey

0 commit comments

Comments
 (0)