@@ -1221,58 +1221,41 @@ bool print_stack(JSContext *cx, FILE *fp) {
1221
1221
// TODO: Support the other possible inputs to Body.
1222
1222
JS::Result<std::tuple<JS::UniqueChars, size_t >> convertBodyInit (JSContext *cx,
1223
1223
JS::HandleValue bodyInit) {
1224
- fprintf (stderr, " a" );
1225
1224
JS::RootedObject bodyObj (cx, bodyInit.isObject () ? &bodyInit.toObject () : nullptr );
1226
- fprintf (stderr, " b" );
1227
1225
mozilla::Maybe<JS::AutoCheckCannotGC> maybeNoGC;
1228
1226
JS::UniqueChars buf;
1229
1227
size_t length;
1230
1228
1231
1229
if (bodyObj && JS_IsArrayBufferViewObject (bodyObj)) {
1232
- fprintf (stderr, " ca" );
1233
1230
// `maybeNoGC` needs to be populated for the lifetime of `buf` because
1234
1231
// short typed arrays have inline data which can move on GC, so assert
1235
1232
// that no GC happens. (Which it doesn't, because we're not allocating
1236
1233
// before `buf` goes out of scope.)
1237
1234
maybeNoGC.emplace (cx);
1238
1235
JS::AutoCheckCannotGC &noGC = maybeNoGC.ref ();
1239
- fprintf (stderr, " da" );
1240
1236
bool is_shared;
1241
1237
length = JS_GetArrayBufferViewByteLength (bodyObj);
1242
- fprintf (stderr, " ea" );
1243
1238
buf = JS::UniqueChars (
1244
1239
reinterpret_cast <char *>(JS_GetArrayBufferViewData (bodyObj, &is_shared, noGC)));
1245
- fprintf (stderr, " fa" );
1246
1240
MOZ_ASSERT (!is_shared);
1247
1241
} else if (bodyObj && JS::IsArrayBufferObject (bodyObj)) {
1248
- fprintf (stderr, " cb" );
1249
1242
bool is_shared;
1250
1243
uint8_t *bytes;
1251
1244
JS::GetArrayBufferLengthAndData (bodyObj, &length, &is_shared, &bytes);
1252
- fprintf (stderr, " db" );
1253
1245
MOZ_ASSERT (!is_shared);
1254
1246
buf.reset (reinterpret_cast <char *>(bytes));
1255
- fprintf (stderr, " eb" );
1256
1247
} else if (bodyObj && builtins::URLSearchParams::is_instance (bodyObj)) {
1257
- fprintf (stderr, " dc" );
1258
1248
jsurl::SpecSlice slice = builtins::URLSearchParams::serialize (cx, bodyObj);
1259
- fprintf (stderr, " ec" );
1260
1249
buf = JS::UniqueChars (reinterpret_cast <char *>(const_cast <uint8_t *>(slice.data )));
1261
- fprintf (stderr, " fc" );
1262
1250
length = slice.len ;
1263
1251
} else {
1264
- fprintf (stderr, " dd" );
1265
1252
// Convert into a String following https://tc39.es/ecma262/#sec-tostring
1266
1253
auto str = core::encode (cx, bodyInit);
1267
- fprintf (stderr, " ed" );
1268
1254
buf = std::move (str.ptr );
1269
- fprintf (stderr, " fd" );
1270
1255
length = str.len ;
1271
1256
if (!buf) {
1272
- fprintf (stderr, " gd" );
1273
1257
return JS::Result<std::tuple<JS::UniqueChars, size_t >>(JS::Error ());
1274
1258
}
1275
1259
}
1276
- fprintf (stderr, " h" );
1277
1260
return JS::Result<std::tuple<JS::UniqueChars, size_t >>(std::make_tuple (std::move (buf), length));
1278
1261
}
0 commit comments