@@ -700,32 +700,31 @@ Intercepted ContextifyContext::PropertyDefinerCallback(
700700 if (desc.has_configurable ()) {
701701 desc_for_sandbox->set_configurable (desc.configurable ());
702702 }
703- // Set the property on the sandbox.
704- USE (sandbox->DefineProperty (context, property, *desc_for_sandbox));
703+ return sandbox->DefineProperty (context, property, *desc_for_sandbox);
705704 };
706705
707706 if (desc.has_get () || desc.has_set ()) {
708707 PropertyDescriptor desc_for_sandbox (
709708 desc.has_get () ? desc.get () : Undefined (isolate).As <Value>(),
710709 desc.has_set () ? desc.set () : Undefined (isolate).As <Value>());
711710
712- define_prop_on_sandbox (&desc_for_sandbox);
713- // TODO(https://github.com/nodejs/node/issues/52634): this should return
714- // kYes to behave according to the expected semantics.
711+ if (define_prop_on_sandbox (&desc_for_sandbox).FromMaybe (false ))
712+ return Intercepted::kYes ;
715713 return Intercepted::kNo ;
716714 } else {
717715 Local<Value> value =
718716 desc.has_value () ? desc.value () : Undefined (isolate).As <Value>();
719717
718+ Maybe<bool > result;
720719 if (desc.has_writable ()) {
721720 PropertyDescriptor desc_for_sandbox (value, desc.writable ());
722- define_prop_on_sandbox (&desc_for_sandbox);
721+ result = define_prop_on_sandbox (&desc_for_sandbox);
723722 } else {
724723 PropertyDescriptor desc_for_sandbox (value);
725- define_prop_on_sandbox (&desc_for_sandbox);
724+ result = define_prop_on_sandbox (&desc_for_sandbox);
726725 }
727- // TODO(https://github.com/nodejs/node/issues/52634): this should return
728- // kYes to behave according to the expected semantics.
726+
727+ if (result. FromMaybe ( false )) return Intercepted:: kYes ;
729728 return Intercepted::kNo ;
730729 }
731730}
0 commit comments