Skip to content
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

Rename GetPrototype() uses to GetPrototypeV2() #2872

Merged
merged 1 commit into from
Oct 9, 2024
Merged
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
4 changes: 2 additions & 2 deletions src/workerd/io/worker.c++
Original file line number Diff line number Diff line change
Expand Up @@ -1802,8 +1802,8 @@ void Worker::handleLog(jsg::Lock& js,

// Determine whether `obj` is constructed using `{}` or `new Object()`. This ensures
// we don't serialise values like Promises to JSON.
if (obj->GetPrototype()->SameValue(freshObj->GetPrototype()) ||
obj->GetPrototype()->IsNull()) {
if (obj->GetPrototypeV2()->SameValue(freshObj->GetPrototypeV2()) ||
obj->GetPrototypeV2()->IsNull()) {
shouldSerialiseToJson = true;
}

Expand Down
2 changes: 1 addition & 1 deletion src/workerd/jsg/ser.c++
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ v8::Maybe<bool> Serializer::IsHostObject(v8::Isolate* isolate, v8::Local<v8::Obj
// to be serialized normally. Otherwise, it is a class instance, which we should treat as a host
// object. Inside `WriteHostObject()` we will throw DataCloneError due to the object not having
// internal fields.
return v8::Just(object->GetPrototype() != prototypeOfObject);
return v8::Just(object->GetPrototypeV2() != prototypeOfObject);
}

v8::Maybe<bool> Serializer::WriteHostObject(v8::Isolate* isolate, v8::Local<v8::Object> object) {
Expand Down