mirror of
https://github.com/lightpanda-io/browser.git
synced 2026-03-22 12:44:43 +00:00
Handle dynamicModuleCallback being called with undefined/null resource_name
Fixes WPT test: /semantics/scripting-1/the-script-element/module/dynamic-import/string-compilation-of-promise-result.html
This commit is contained in:
@@ -600,9 +600,18 @@ pub fn dynamicModuleCallback(
|
|||||||
.isolate = self.isolate,
|
.isolate = self.isolate,
|
||||||
};
|
};
|
||||||
|
|
||||||
const resource = js.String.toSliceZ(.{ .local = &local, .handle = resource_name.? }) catch |err| {
|
const resource = blk: {
|
||||||
log.err(.app, "OOM", .{ .err = err, .src = "dynamicModuleCallback1" });
|
const resource_value = js.Value{ .handle = resource_name.?, .local = &local };
|
||||||
return @constCast((local.rejectPromise("Out of memory") catch return null).handle);
|
if (resource_value.isNullOrUndefined()) {
|
||||||
|
// will only be null / undefined in extreme cases (e.g. WPT tests)
|
||||||
|
// where you're
|
||||||
|
break :blk self.page.base();
|
||||||
|
}
|
||||||
|
|
||||||
|
break :blk js.String.toSliceZ(.{ .local = &local, .handle = resource_name.? }) catch |err| {
|
||||||
|
log.err(.app, "OOM", .{ .err = err, .src = "dynamicModuleCallback1" });
|
||||||
|
return @constCast((local.rejectPromise("Out of memory") catch return null).handle);
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
const specifier = js.String.toSliceZ(.{ .local = &local, .handle = v8_specifier.? }) catch |err| {
|
const specifier = js.String.toSliceZ(.{ .local = &local, .handle = v8_specifier.? }) catch |err| {
|
||||||
|
|||||||
Reference in New Issue
Block a user