cppgc-js: Fix TraitTrait for v8::TracedReference

Trait requires methods taking `const void*` as they are passed along
as regular TraceCallback.

Bug: v8:12165
Change-Id: Ic5cfb8dba070e5a2c0087069086c925c5318fb8b
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3253354
Reviewed-by: Omer Katz <omerkatz@chromium.org>
Commit-Queue: Michael Lippautz <mlippautz@chromium.org>
Cr-Commit-Position: refs/heads/main@{#77623}
This commit is contained in:
Michael Lippautz 2021-10-29 16:47:03 +02:00 committed by V8 LUCI CQ
parent 4bdc9097a3
commit c019bbbfe2

View File

@ -318,13 +318,13 @@ namespace cppgc {
template <typename T>
struct TraceTrait<v8::TracedReference<T>> {
static cppgc::TraceDescriptor GetTraceDescriptor(
const v8::TracedReference<T>* ref) {
static cppgc::TraceDescriptor GetTraceDescriptor(const void* self) {
return {nullptr, Trace};
}
static void Trace(Visitor* visitor, const v8::TracedReference<T>* self) {
static_cast<v8::JSVisitor*>(visitor)->Trace(*self);
static void Trace(Visitor* visitor, const void* self) {
static_cast<v8::JSVisitor*>(visitor)->Trace(
*static_cast<const v8::TracedReference<T>*>(self));
}
};