From 8989c76c6eff653a3abb19f4cfb3097da58b5dce Mon Sep 17 00:00:00 2001 From: Anna Henningsen Date: Mon, 17 Sep 2018 20:13:59 +0200 Subject: Revert "src: implement query callbacks for vm" This reverts commit 85c356c10eec14f96eaf92ffc9a8481b591e3652 from PR https://github.com/nodejs/node/pull/22390. See the discussion in the (proposed) fix at https://github.com/nodejs/node/pull/22836. Refs: https://github.com/nodejs/node/pull/22836 Refs: https://github.com/nodejs/node/pull/22390 Fixes: https://github.com/nodejs/node/issues/22723 PR-URL: https://github.com/nodejs/node/pull/22911 Reviewed-By: Colin Ihrig Reviewed-By: Gus Caplan Reviewed-By: Tiancheng "Timothy" Gu Reviewed-By: John-David Dalton Reviewed-By: Ruben Bridgewater --- src/node_contextify.cc | 42 ++---------------------------------------- 1 file changed, 2 insertions(+), 40 deletions(-) (limited to 'src/node_contextify.cc') diff --git a/src/node_contextify.cc b/src/node_contextify.cc index 92e2ed9429..8b9fef5480 100644 --- a/src/node_contextify.cc +++ b/src/node_contextify.cc @@ -143,21 +143,19 @@ Local ContextifyContext::CreateV8Context( NamedPropertyHandlerConfiguration config(PropertyGetterCallback, PropertySetterCallback, - PropertyQueryCallback, + PropertyDescriptorCallback, PropertyDeleterCallback, PropertyEnumeratorCallback, PropertyDefinerCallback, - PropertyDescriptorCallback, CreateDataWrapper(env)); IndexedPropertyHandlerConfiguration indexed_config( IndexedPropertyGetterCallback, IndexedPropertySetterCallback, - IndexedPropertyQueryCallback, + IndexedPropertyDescriptorCallback, IndexedPropertyDeleterCallback, PropertyEnumeratorCallback, IndexedPropertyDefinerCallback, - IndexedPropertyDescriptorCallback, CreateDataWrapper(env)); object_template->SetHandler(config); @@ -393,28 +391,6 @@ void ContextifyContext::PropertySetterCallback( ctx->sandbox()->Set(property, value); } -// static -void ContextifyContext::PropertyQueryCallback( - Local property, - const PropertyCallbackInfo& args) { - ContextifyContext* ctx = ContextifyContext::Get(args); - - // Still initializing - if (ctx->context_.IsEmpty()) - return; - - Local context = ctx->context(); - - Local sandbox = ctx->sandbox(); - - PropertyAttribute attributes; - if (sandbox->HasOwnProperty(context, property).FromMaybe(false) && - sandbox->GetPropertyAttributes(context, property).To(&attributes)) { - args.GetReturnValue().Set(attributes); - } -} - - // static void ContextifyContext::PropertyDescriptorCallback( Local property, @@ -560,20 +536,6 @@ void ContextifyContext::IndexedPropertySetterCallback( Uint32ToName(ctx->context(), index), value, args); } -// static -void ContextifyContext::IndexedPropertyQueryCallback( - uint32_t index, - const PropertyCallbackInfo& args) { - ContextifyContext* ctx = ContextifyContext::Get(args); - - // Still initializing - if (ctx->context_.IsEmpty()) - return; - - ContextifyContext::PropertyQueryCallback( - Uint32ToName(ctx->context(), index), args); -} - // static void ContextifyContext::IndexedPropertyDescriptorCallback( uint32_t index, -- cgit v1.2.3