mirror of
https://github.com/lightpanda-io/browser.git
synced 2025-10-28 14:43:28 +00:00
Merge pull request #325 from lightpanda-io/await_promise
Some checks failed
wpt / web platform tests (push) Has been cancelled
zig-test / zig build dev (push) Has been cancelled
zig-test / zig build release (push) Has been cancelled
zig-test / zig test (push) Has been cancelled
wpt / perf-fmt (push) Has been cancelled
zig-test / perf-fmt (push) Has been cancelled
Some checks failed
wpt / web platform tests (push) Has been cancelled
zig-test / zig build dev (push) Has been cancelled
zig-test / zig build release (push) Has been cancelled
zig-test / zig test (push) Has been cancelled
wpt / perf-fmt (push) Has been cancelled
zig-test / perf-fmt (push) Has been cancelled
cdp: runtime, replace `"awaitPromise":true` only if present
This commit is contained in:
@@ -119,13 +119,16 @@ fn sendInspector(
|
|||||||
// remove awaitPromise true params
|
// remove awaitPromise true params
|
||||||
// TODO: delete when Promise are correctly handled by zig-js-runtime
|
// TODO: delete when Promise are correctly handled by zig-js-runtime
|
||||||
if (method == .callFunctionOn or method == .evaluate) {
|
if (method == .callFunctionOn or method == .evaluate) {
|
||||||
const buf = try alloc.alloc(u8, msg.json.len + 1);
|
if (std.mem.indexOf(u8, msg.json, "\"awaitPromise\":true")) |_| {
|
||||||
defer alloc.free(buf);
|
const buf = try alloc.alloc(u8, msg.json.len + 1);
|
||||||
_ = std.mem.replace(u8, msg.json, "\"awaitPromise\":true", "\"awaitPromise\":false", buf);
|
defer alloc.free(buf);
|
||||||
ctx.sendInspector(buf);
|
_ = std.mem.replace(u8, msg.json, "\"awaitPromise\":true", "\"awaitPromise\":false", buf);
|
||||||
} else {
|
ctx.sendInspector(buf);
|
||||||
ctx.sendInspector(msg.json);
|
return "";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ctx.sendInspector(msg.json);
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user