diff --git a/src/workerd/jsg/type-wrapper.h b/src/workerd/jsg/type-wrapper.h index d5cc28d561b..e3a56ece951 100644 --- a/src/workerd/jsg/type-wrapper.h +++ b/src/workerd/jsg/type-wrapper.h @@ -79,7 +79,7 @@ class V8HandleWrapper { v8::Local handle, v8::Global*, \ kj::Maybe> parentObject) { \ if (handle->Is##type()) { \ - return v8::Global(context->GetIsolate(), handle.As()); \ + return v8::Global(v8::Isolate::GetCurrent(), handle.As()); \ } \ return kj::none; \ } \ @@ -88,7 +88,7 @@ class V8HandleWrapper { v8::Local handle, V8Ref*, \ kj::Maybe> parentObject) { \ if (handle->Is##type()) { \ - return V8Ref(context->GetIsolate(), handle.As()); \ + return V8Ref(v8::Isolate::GetCurrent(), handle.As()); \ } \ return kj::none; \ } \ @@ -97,7 +97,7 @@ class V8HandleWrapper { v8::Local handle, HashableV8Ref*, \ kj::Maybe> parentObject) { \ if (handle->Is##type()) { \ - return HashableV8Ref(context->GetIsolate(), handle.As()); \ + return HashableV8Ref(v8::Isolate::GetCurrent(), handle.As()); \ } \ return kj::none; \ } @@ -116,14 +116,14 @@ class V8HandleWrapper { v8::Local wrap(v8::Local context, kj::Maybe> creator, v8::Global value) { - return value.Get(context->GetIsolate()); + return value.Get(v8::Isolate::GetCurrent()); } kj::Maybe> tryUnwrap(v8::Local context, v8::Local handle, v8::Global*, kj::Maybe> parentObject) { - return v8::Global(context->GetIsolate(), handle); + return v8::Global(v8::Isolate::GetCurrent(), handle); } template ()>> @@ -134,14 +134,14 @@ class V8HandleWrapper { template ()>> v8::Local wrap( v8::Local context, kj::Maybe> creator, V8Ref value) { - return value.getHandle(context->GetIsolate()); + return value.getHandle(v8::Isolate::GetCurrent()); } kj::Maybe> tryUnwrap(v8::Local context, v8::Local handle, V8Ref*, kj::Maybe> parentObject) { - return V8Ref(context->GetIsolate(), handle); + return V8Ref(v8::Isolate::GetCurrent(), handle); } }; @@ -502,7 +502,7 @@ class TypeWrapper: public DynamicResourceTypeMap, return kj::fwd>(result); } else { throwTypeError( - context->GetIsolate(), errorContext, TypeWrapper::getName((kj::Decay*)nullptr)); + v8::Isolate::GetCurrent(), errorContext, TypeWrapper::getName((kj::Decay*)nullptr)); } } @@ -562,7 +562,8 @@ class TypeWrapper: public DynamicResourceTypeMap, // We're unwrapping a nonexistent argument into a required parameter. Since Web IDL // nullable types (Maybe) can be initialized from `undefined`, we need to explicitly // throw here, or else `f(Maybe)` could be called like `f()`. - throwTypeError(context->GetIsolate(), errorContext, TypeWrapper::getName((V*)nullptr)); + throwTypeError( + v8::Isolate::GetCurrent(), errorContext, TypeWrapper::getName((V*)nullptr)); } }