Skip to content

getValueByObjectId #306

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions src/engines/v8/v8.zig
Original file line number Diff line number Diff line change
Expand Up @@ -625,6 +625,10 @@ pub const JSValue = struct {
return error.JSValueTypeNotHandled;
};
}

pub fn externalEntry(self: JSValue) ?*ExternalEntry {
return getExternalEntry(self.value);
}
};

pub const TryCatch = struct {
Expand Down Expand Up @@ -750,6 +754,11 @@ pub const Inspector = struct {
const generatePreview = false; // We do not want to expose this as a parameter for now
return self.session.wrapObject(env.isolate, env.js_ctx.?, jsValue, groupName, generatePreview);
}

pub fn getValueByObjectId(self: Inspector, allocator: std.mem.Allocator, object_id: []const u8) !JSValue {
const unwrapped = try self.session.unwrapObject(allocator, object_id);
return .{ .value = unwrapped.value }; // The values context and groupId are not used here
}
};

// When we return a Zig instance to V8, we wrap it in a v8.Object. That wrapping
Expand Down
2 changes: 1 addition & 1 deletion vendor/zig-v8
Submodule zig-v8 updated 3 files
+93 −34 src/binding.cpp
+29 −13 src/binding.h
+69 −47 src/v8.zig