diff options
author | Anna Henningsen <anna@addaleax.net> | 2018-09-17 21:13:59 +0300 |
---|---|---|
committer | Anna Henningsen <anna@addaleax.net> | 2018-09-18 16:48:02 +0300 |
commit | 8989c76c6eff653a3abb19f4cfb3097da58b5dce (patch) | |
tree | 51fd37839e315cf6d0c1a749da598182365e174e /src/node_contextify.cc | |
parent | dcc0c2c5c9d5bd97cc3df7fe7fd7f34c96e53b5b (diff) |
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 <cjihrig@gmail.com>
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com>
Reviewed-By: John-David Dalton <john.david.dalton@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Diffstat (limited to 'src/node_contextify.cc')
-rw-r--r-- | src/node_contextify.cc | 42 |
1 files changed, 2 insertions, 40 deletions
diff --git a/src/node_contextify.cc b/src/node_contextify.cc index 92e2ed9429d..8b9fef54806 100644 --- a/src/node_contextify.cc +++ b/src/node_contextify.cc @@ -143,21 +143,19 @@ Local<Context> 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); @@ -394,28 +392,6 @@ void ContextifyContext::PropertySetterCallback( } // static -void ContextifyContext::PropertyQueryCallback( - Local<Name> property, - const PropertyCallbackInfo<Integer>& args) { - ContextifyContext* ctx = ContextifyContext::Get(args); - - // Still initializing - if (ctx->context_.IsEmpty()) - return; - - Local<Context> context = ctx->context(); - - Local<Object> 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<Name> property, const PropertyCallbackInfo<Value>& args) { @@ -561,20 +537,6 @@ void ContextifyContext::IndexedPropertySetterCallback( } // static -void ContextifyContext::IndexedPropertyQueryCallback( - uint32_t index, - const PropertyCallbackInfo<Integer>& 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, const PropertyCallbackInfo<Value>& args) { |