diff --git a/src/node_contextify.cc b/src/node_contextify.cc index e6e2d123c04278..7926965302161c 100644 --- a/src/node_contextify.cc +++ b/src/node_contextify.cc @@ -1224,15 +1224,18 @@ static void MeasureMemory(const FunctionCallbackInfo& args) { args[1].As()); CHECK_NOT_NULL(sandbox); context = sandbox->context(); - if (context.IsEmpty()) { // Not yet fully initilaized + if (context.IsEmpty()) { // Not yet fully initialized return; } } - v8::Local promise; - if (!isolate->MeasureMemory(context, static_cast(mode)) - .ToLocal(&promise)) { - return; - } + Local resolver; + if (!Promise::Resolver::New(context).ToLocal(&resolver)) return; + std::unique_ptr i = + v8::MeasureMemoryDelegate::Default( + isolate, context, resolver, static_cast(mode)); + CHECK_NOT_NULL(i); + v8::Local promise = resolver->GetPromise(); + args.GetReturnValue().Set(promise); }