mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 06:47:35 +00:00
LibWeb: Propagate Realm instead of VM more through Fetch
This makes Fetch rely less on using main_thread_vm().current_realm(), which relies on the dummy execution context if no JavaScript is currently running.
This commit is contained in:
parent
f7ff1fd985
commit
9acc542059
19 changed files with 62 additions and 49 deletions
|
@ -132,7 +132,7 @@ WebIDL::ExceptionOr<JS::Value> package_data(JS::Realm& realm, ByteBuffer bytes,
|
|||
}
|
||||
case PackageDataType::JSON:
|
||||
// Return the result of running parse JSON from bytes on bytes.
|
||||
return Infra::parse_json_bytes_to_javascript_value(vm, bytes);
|
||||
return Infra::parse_json_bytes_to_javascript_value(realm, bytes);
|
||||
case PackageDataType::Text:
|
||||
// Return the result of running UTF-8 decode on bytes.
|
||||
return JS::PrimitiveString::create(vm, TRY_OR_THROW_OOM(vm, String::from_utf8(bytes)));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue