fix_add_property_query_interceptors.patch 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574
  1. From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
  2. From: VerteDinde <[email protected]>
  3. Date: Mon, 24 Jun 2024 21:48:40 -0700
  4. Subject: fix: add property query interceptors
  5. This commit cherry-picks an upstream interceptor API change
  6. from node-v8/canary to accomodate V8's upstream changes to old
  7. interceptor APIs.
  8. Node PR: https://github.com/nodejs/node-v8/commit/d1f18b0bf16efbc1e54ba04a54735ce4683cb936
  9. CL: https://chromium-review.googlesource.com/c/v8/v8/+/5630388
  10. This patch can be removed when the node change is incorporated into main.
  11. diff --git a/src/node_contextify.cc b/src/node_contextify.cc
  12. index 28ba7dbe66a44a43c39e3d75edf0be9513bcf732..0401b968916e5f45d148281c74b7e465e11439b8 100644
  13. --- a/src/node_contextify.cc
  14. +++ b/src/node_contextify.cc
  15. @@ -49,6 +49,7 @@ using v8::FunctionTemplate;
  16. using v8::HandleScope;
  17. using v8::IndexedPropertyHandlerConfiguration;
  18. using v8::Int32;
  19. +using v8::Intercepted;
  20. using v8::Isolate;
  21. using v8::Just;
  22. using v8::Local;
  23. @@ -484,14 +485,15 @@ bool ContextifyContext::IsStillInitializing(const ContextifyContext* ctx) {
  24. }
  25. // static
  26. -void ContextifyContext::PropertyGetterCallback(
  27. - Local<Name> property,
  28. - const PropertyCallbackInfo<Value>& args) {
  29. +Intercepted ContextifyContext::PropertyGetterCallback(
  30. + Local<Name> property, const PropertyCallbackInfo<Value>& args) {
  31. Environment* env = Environment::GetCurrent(args);
  32. ContextifyContext* ctx = ContextifyContext::Get(args);
  33. // Still initializing
  34. - if (IsStillInitializing(ctx)) return;
  35. + if (IsStillInitializing(ctx)) {
  36. + return Intercepted::kNo;
  37. + }
  38. Local<Context> context = ctx->context();
  39. Local<Object> sandbox = ctx->sandbox();
  40. @@ -515,18 +517,22 @@ void ContextifyContext::PropertyGetterCallback(
  41. rv = ctx->global_proxy();
  42. args.GetReturnValue().Set(rv);
  43. + return Intercepted::kYes;
  44. }
  45. + return Intercepted::kNo;
  46. }
  47. // static
  48. -void ContextifyContext::PropertySetterCallback(
  49. +Intercepted ContextifyContext::PropertySetterCallback(
  50. Local<Name> property,
  51. Local<Value> value,
  52. - const PropertyCallbackInfo<Value>& args) {
  53. + const PropertyCallbackInfo<void>& args) {
  54. ContextifyContext* ctx = ContextifyContext::Get(args);
  55. // Still initializing
  56. - if (IsStillInitializing(ctx)) return;
  57. + if (IsStillInitializing(ctx)) {
  58. + return Intercepted::kNo;
  59. + }
  60. Local<Context> context = ctx->context();
  61. PropertyAttribute attributes = PropertyAttribute::None;
  62. @@ -544,8 +550,9 @@ void ContextifyContext::PropertySetterCallback(
  63. (static_cast<int>(attributes) &
  64. static_cast<int>(PropertyAttribute::ReadOnly));
  65. - if (read_only)
  66. - return;
  67. + if (read_only) {
  68. + return Intercepted::kNo;
  69. + }
  70. // true for x = 5
  71. // false for this.x = 5
  72. @@ -564,11 +571,16 @@ void ContextifyContext::PropertySetterCallback(
  73. bool is_declared = is_declared_on_global_proxy || is_declared_on_sandbox;
  74. if (!is_declared && args.ShouldThrowOnError() && is_contextual_store &&
  75. - !is_function)
  76. - return;
  77. + !is_function) {
  78. + return Intercepted::kNo;
  79. + }
  80. - if (!is_declared && property->IsSymbol()) return;
  81. - if (ctx->sandbox()->Set(context, property, value).IsNothing()) return;
  82. + if (!is_declared && property->IsSymbol()) {
  83. + return Intercepted::kNo;
  84. + }
  85. + if (ctx->sandbox()->Set(context, property, value).IsNothing()) {
  86. + return Intercepted::kNo;
  87. + }
  88. Local<Value> desc;
  89. if (is_declared_on_sandbox &&
  90. @@ -582,19 +594,23 @@ void ContextifyContext::PropertySetterCallback(
  91. // We have to specify the return value for any contextual or get/set
  92. // property
  93. if (desc_obj->HasOwnProperty(context, env->get_string()).FromMaybe(false) ||
  94. - desc_obj->HasOwnProperty(context, env->set_string()).FromMaybe(false))
  95. + desc_obj->HasOwnProperty(context, env->set_string()).FromMaybe(false)) {
  96. args.GetReturnValue().Set(value);
  97. + return Intercepted::kYes;
  98. + }
  99. }
  100. + return Intercepted::kNo;
  101. }
  102. // static
  103. -void ContextifyContext::PropertyDescriptorCallback(
  104. - Local<Name> property,
  105. - const PropertyCallbackInfo<Value>& args) {
  106. +Intercepted ContextifyContext::PropertyDescriptorCallback(
  107. + Local<Name> property, const PropertyCallbackInfo<Value>& args) {
  108. ContextifyContext* ctx = ContextifyContext::Get(args);
  109. // Still initializing
  110. - if (IsStillInitializing(ctx)) return;
  111. + if (IsStillInitializing(ctx)) {
  112. + return Intercepted::kNo;
  113. + }
  114. Local<Context> context = ctx->context();
  115. @@ -604,19 +620,23 @@ void ContextifyContext::PropertyDescriptorCallback(
  116. Local<Value> desc;
  117. if (sandbox->GetOwnPropertyDescriptor(context, property).ToLocal(&desc)) {
  118. args.GetReturnValue().Set(desc);
  119. + return Intercepted::kYes;
  120. }
  121. }
  122. + return Intercepted::kNo;
  123. }
  124. // static
  125. -void ContextifyContext::PropertyDefinerCallback(
  126. +Intercepted ContextifyContext::PropertyDefinerCallback(
  127. Local<Name> property,
  128. const PropertyDescriptor& desc,
  129. - const PropertyCallbackInfo<Value>& args) {
  130. + const PropertyCallbackInfo<void>& args) {
  131. ContextifyContext* ctx = ContextifyContext::Get(args);
  132. // Still initializing
  133. - if (IsStillInitializing(ctx)) return;
  134. + if (IsStillInitializing(ctx)) {
  135. + return Intercepted::kNo;
  136. + }
  137. Local<Context> context = ctx->context();
  138. Isolate* isolate = context->GetIsolate();
  139. @@ -635,7 +655,7 @@ void ContextifyContext::PropertyDefinerCallback(
  140. // If the property is set on the global as neither writable nor
  141. // configurable, don't change it on the global or sandbox.
  142. if (is_declared && read_only && dont_delete) {
  143. - return;
  144. + return Intercepted::kNo;
  145. }
  146. Local<Object> sandbox = ctx->sandbox();
  147. @@ -658,6 +678,9 @@ void ContextifyContext::PropertyDefinerCallback(
  148. desc.has_set() ? desc.set() : Undefined(isolate).As<Value>());
  149. define_prop_on_sandbox(&desc_for_sandbox);
  150. + // TODO(https://github.com/nodejs/node/issues/52634): this should return
  151. + // kYes to behave according to the expected semantics.
  152. + return Intercepted::kNo;
  153. } else {
  154. Local<Value> value =
  155. desc.has_value() ? desc.value() : Undefined(isolate).As<Value>();
  156. @@ -669,26 +692,32 @@ void ContextifyContext::PropertyDefinerCallback(
  157. PropertyDescriptor desc_for_sandbox(value);
  158. define_prop_on_sandbox(&desc_for_sandbox);
  159. }
  160. + // TODO(https://github.com/nodejs/node/issues/52634): this should return
  161. + // kYes to behave according to the expected semantics.
  162. + return Intercepted::kNo;
  163. }
  164. }
  165. // static
  166. -void ContextifyContext::PropertyDeleterCallback(
  167. - Local<Name> property,
  168. - const PropertyCallbackInfo<Boolean>& args) {
  169. +Intercepted ContextifyContext::PropertyDeleterCallback(
  170. + Local<Name> property, const PropertyCallbackInfo<Boolean>& args) {
  171. ContextifyContext* ctx = ContextifyContext::Get(args);
  172. // Still initializing
  173. - if (IsStillInitializing(ctx)) return;
  174. + if (IsStillInitializing(ctx)) {
  175. + return Intercepted::kNo;
  176. + }
  177. Maybe<bool> success = ctx->sandbox()->Delete(ctx->context(), property);
  178. - if (success.FromMaybe(false))
  179. - return;
  180. + if (success.FromMaybe(false)) {
  181. + return Intercepted::kNo;
  182. + }
  183. // Delete failed on the sandbox, intercept and do not delete on
  184. // the global object.
  185. args.GetReturnValue().Set(false);
  186. + return Intercepted::kYes;
  187. }
  188. // static
  189. @@ -708,76 +737,84 @@ void ContextifyContext::PropertyEnumeratorCallback(
  190. }
  191. // static
  192. -void ContextifyContext::IndexedPropertyGetterCallback(
  193. - uint32_t index,
  194. - const PropertyCallbackInfo<Value>& args) {
  195. +Intercepted ContextifyContext::IndexedPropertyGetterCallback(
  196. + uint32_t index, const PropertyCallbackInfo<Value>& args) {
  197. ContextifyContext* ctx = ContextifyContext::Get(args);
  198. // Still initializing
  199. - if (IsStillInitializing(ctx)) return;
  200. + if (IsStillInitializing(ctx)) {
  201. + return Intercepted::kNo;
  202. + }
  203. - ContextifyContext::PropertyGetterCallback(
  204. + return ContextifyContext::PropertyGetterCallback(
  205. Uint32ToName(ctx->context(), index), args);
  206. }
  207. -
  208. -void ContextifyContext::IndexedPropertySetterCallback(
  209. +Intercepted ContextifyContext::IndexedPropertySetterCallback(
  210. uint32_t index,
  211. Local<Value> value,
  212. - const PropertyCallbackInfo<Value>& args) {
  213. + const PropertyCallbackInfo<void>& args) {
  214. ContextifyContext* ctx = ContextifyContext::Get(args);
  215. // Still initializing
  216. - if (IsStillInitializing(ctx)) return;
  217. + if (IsStillInitializing(ctx)) {
  218. + return Intercepted::kNo;
  219. + }
  220. - ContextifyContext::PropertySetterCallback(
  221. + return ContextifyContext::PropertySetterCallback(
  222. Uint32ToName(ctx->context(), index), value, args);
  223. }
  224. // static
  225. -void ContextifyContext::IndexedPropertyDescriptorCallback(
  226. - uint32_t index,
  227. - const PropertyCallbackInfo<Value>& args) {
  228. +Intercepted ContextifyContext::IndexedPropertyDescriptorCallback(
  229. + uint32_t index, const PropertyCallbackInfo<Value>& args) {
  230. ContextifyContext* ctx = ContextifyContext::Get(args);
  231. // Still initializing
  232. - if (IsStillInitializing(ctx)) return;
  233. + if (IsStillInitializing(ctx)) {
  234. + return Intercepted::kNo;
  235. + }
  236. - ContextifyContext::PropertyDescriptorCallback(
  237. + return ContextifyContext::PropertyDescriptorCallback(
  238. Uint32ToName(ctx->context(), index), args);
  239. }
  240. -void ContextifyContext::IndexedPropertyDefinerCallback(
  241. +Intercepted ContextifyContext::IndexedPropertyDefinerCallback(
  242. uint32_t index,
  243. const PropertyDescriptor& desc,
  244. - const PropertyCallbackInfo<Value>& args) {
  245. + const PropertyCallbackInfo<void>& args) {
  246. ContextifyContext* ctx = ContextifyContext::Get(args);
  247. // Still initializing
  248. - if (IsStillInitializing(ctx)) return;
  249. + if (IsStillInitializing(ctx)) {
  250. + return Intercepted::kNo;
  251. + }
  252. - ContextifyContext::PropertyDefinerCallback(
  253. + return ContextifyContext::PropertyDefinerCallback(
  254. Uint32ToName(ctx->context(), index), desc, args);
  255. }
  256. // static
  257. -void ContextifyContext::IndexedPropertyDeleterCallback(
  258. - uint32_t index,
  259. - const PropertyCallbackInfo<Boolean>& args) {
  260. +Intercepted ContextifyContext::IndexedPropertyDeleterCallback(
  261. + uint32_t index, const PropertyCallbackInfo<Boolean>& args) {
  262. ContextifyContext* ctx = ContextifyContext::Get(args);
  263. // Still initializing
  264. - if (IsStillInitializing(ctx)) return;
  265. + if (IsStillInitializing(ctx)) {
  266. + return Intercepted::kNo;
  267. + }
  268. Maybe<bool> success = ctx->sandbox()->Delete(ctx->context(), index);
  269. - if (success.FromMaybe(false))
  270. - return;
  271. + if (success.FromMaybe(false)) {
  272. + return Intercepted::kNo;
  273. + }
  274. // Delete failed on the sandbox, intercept and do not delete on
  275. // the global object.
  276. args.GetReturnValue().Set(false);
  277. + return Intercepted::kYes;
  278. }
  279. void ContextifyScript::CreatePerIsolateProperties(
  280. diff --git a/src/node_contextify.h b/src/node_contextify.h
  281. index 10715c7eb07715cc11e49734bd54747dad95f6a4..49b9fabb399aed962e0d29e784a25ca4e9780a8f 100644
  282. --- a/src/node_contextify.h
  283. +++ b/src/node_contextify.h
  284. @@ -111,42 +111,39 @@ class ContextifyContext : public BaseObject {
  285. const v8::FunctionCallbackInfo<v8::Value>& args);
  286. static void WeakCallback(
  287. const v8::WeakCallbackInfo<ContextifyContext>& data);
  288. - static void PropertyGetterCallback(
  289. + static v8::Intercepted PropertyGetterCallback(
  290. v8::Local<v8::Name> property,
  291. const v8::PropertyCallbackInfo<v8::Value>& args);
  292. - static void PropertySetterCallback(
  293. + static v8::Intercepted PropertySetterCallback(
  294. v8::Local<v8::Name> property,
  295. v8::Local<v8::Value> value,
  296. - const v8::PropertyCallbackInfo<v8::Value>& args);
  297. - static void PropertyDescriptorCallback(
  298. + const v8::PropertyCallbackInfo<void>& args);
  299. + static v8::Intercepted PropertyDescriptorCallback(
  300. v8::Local<v8::Name> property,
  301. const v8::PropertyCallbackInfo<v8::Value>& args);
  302. - static void PropertyDefinerCallback(
  303. + static v8::Intercepted PropertyDefinerCallback(
  304. v8::Local<v8::Name> property,
  305. const v8::PropertyDescriptor& desc,
  306. - const v8::PropertyCallbackInfo<v8::Value>& args);
  307. - static void PropertyDeleterCallback(
  308. + const v8::PropertyCallbackInfo<void>& args);
  309. + static v8::Intercepted PropertyDeleterCallback(
  310. v8::Local<v8::Name> property,
  311. const v8::PropertyCallbackInfo<v8::Boolean>& args);
  312. static void PropertyEnumeratorCallback(
  313. const v8::PropertyCallbackInfo<v8::Array>& args);
  314. - static void IndexedPropertyGetterCallback(
  315. - uint32_t index,
  316. - const v8::PropertyCallbackInfo<v8::Value>& args);
  317. - static void IndexedPropertySetterCallback(
  318. + static v8::Intercepted IndexedPropertyGetterCallback(
  319. + uint32_t index, const v8::PropertyCallbackInfo<v8::Value>& args);
  320. + static v8::Intercepted IndexedPropertySetterCallback(
  321. uint32_t index,
  322. v8::Local<v8::Value> value,
  323. - const v8::PropertyCallbackInfo<v8::Value>& args);
  324. - static void IndexedPropertyDescriptorCallback(
  325. - uint32_t index,
  326. - const v8::PropertyCallbackInfo<v8::Value>& args);
  327. - static void IndexedPropertyDefinerCallback(
  328. + const v8::PropertyCallbackInfo<void>& args);
  329. + static v8::Intercepted IndexedPropertyDescriptorCallback(
  330. + uint32_t index, const v8::PropertyCallbackInfo<v8::Value>& args);
  331. + static v8::Intercepted IndexedPropertyDefinerCallback(
  332. uint32_t index,
  333. const v8::PropertyDescriptor& desc,
  334. - const v8::PropertyCallbackInfo<v8::Value>& args);
  335. - static void IndexedPropertyDeleterCallback(
  336. - uint32_t index,
  337. - const v8::PropertyCallbackInfo<v8::Boolean>& args);
  338. + const v8::PropertyCallbackInfo<void>& args);
  339. + static v8::Intercepted IndexedPropertyDeleterCallback(
  340. + uint32_t index, const v8::PropertyCallbackInfo<v8::Boolean>& args);
  341. v8::Global<v8::Context> context_;
  342. std::unique_ptr<v8::MicrotaskQueue> microtask_queue_;
  343. diff --git a/src/node_env_var.cc b/src/node_env_var.cc
  344. index bce7ae07214ddf970a530db29ed6970e14b7a5ed..85f82180d48d6cfd7738cd7b1e504f23b38153e8 100644
  345. --- a/src/node_env_var.cc
  346. +++ b/src/node_env_var.cc
  347. @@ -16,6 +16,7 @@ using v8::DontEnum;
  348. using v8::FunctionTemplate;
  349. using v8::HandleScope;
  350. using v8::Integer;
  351. +using v8::Intercepted;
  352. using v8::Isolate;
  353. using v8::Just;
  354. using v8::Local;
  355. @@ -336,24 +337,27 @@ Maybe<bool> KVStore::AssignToObject(v8::Isolate* isolate,
  356. return Just(true);
  357. }
  358. -static void EnvGetter(Local<Name> property,
  359. - const PropertyCallbackInfo<Value>& info) {
  360. +static Intercepted EnvGetter(Local<Name> property,
  361. + const PropertyCallbackInfo<Value>& info) {
  362. Environment* env = Environment::GetCurrent(info);
  363. CHECK(env->has_run_bootstrapping_code());
  364. if (property->IsSymbol()) {
  365. - return info.GetReturnValue().SetUndefined();
  366. + info.GetReturnValue().SetUndefined();
  367. + return Intercepted::kYes;
  368. }
  369. CHECK(property->IsString());
  370. MaybeLocal<String> value_string =
  371. env->env_vars()->Get(env->isolate(), property.As<String>());
  372. if (!value_string.IsEmpty()) {
  373. info.GetReturnValue().Set(value_string.ToLocalChecked());
  374. + return Intercepted::kYes;
  375. }
  376. + return Intercepted::kNo;
  377. }
  378. -static void EnvSetter(Local<Name> property,
  379. - Local<Value> value,
  380. - const PropertyCallbackInfo<Value>& info) {
  381. +static Intercepted EnvSetter(Local<Name> property,
  382. + Local<Value> value,
  383. + const PropertyCallbackInfo<void>& info) {
  384. Environment* env = Environment::GetCurrent(info);
  385. CHECK(env->has_run_bootstrapping_code());
  386. // calling env->EmitProcessEnvWarning() sets a variable indicating that
  387. @@ -369,35 +373,40 @@ static void EnvSetter(Local<Name> property,
  388. "the "
  389. "value to a string before setting process.env with it.",
  390. "DEP0104")
  391. - .IsNothing())
  392. - return;
  393. + .IsNothing()) {
  394. + return Intercepted::kNo;
  395. + }
  396. }
  397. Local<String> key;
  398. Local<String> value_string;
  399. if (!property->ToString(env->context()).ToLocal(&key) ||
  400. !value->ToString(env->context()).ToLocal(&value_string)) {
  401. - return;
  402. + return Intercepted::kNo;
  403. }
  404. env->env_vars()->Set(env->isolate(), key, value_string);
  405. - // Whether it worked or not, always return value.
  406. - info.GetReturnValue().Set(value);
  407. + return Intercepted::kYes;
  408. }
  409. -static void EnvQuery(Local<Name> property,
  410. - const PropertyCallbackInfo<Integer>& info) {
  411. +static Intercepted EnvQuery(Local<Name> property,
  412. + const PropertyCallbackInfo<Integer>& info) {
  413. Environment* env = Environment::GetCurrent(info);
  414. CHECK(env->has_run_bootstrapping_code());
  415. if (property->IsString()) {
  416. int32_t rc = env->env_vars()->Query(env->isolate(), property.As<String>());
  417. - if (rc != -1) info.GetReturnValue().Set(rc);
  418. + if (rc != -1) {
  419. + // Return attributes for the property.
  420. + info.GetReturnValue().Set(v8::None);
  421. + return Intercepted::kYes;
  422. + }
  423. }
  424. + return Intercepted::kNo;
  425. }
  426. -static void EnvDeleter(Local<Name> property,
  427. - const PropertyCallbackInfo<Boolean>& info) {
  428. +static Intercepted EnvDeleter(Local<Name> property,
  429. + const PropertyCallbackInfo<Boolean>& info) {
  430. Environment* env = Environment::GetCurrent(info);
  431. CHECK(env->has_run_bootstrapping_code());
  432. if (property->IsString()) {
  433. @@ -407,6 +416,7 @@ static void EnvDeleter(Local<Name> property,
  434. // process.env never has non-configurable properties, so always
  435. // return true like the tc39 delete operator.
  436. info.GetReturnValue().Set(true);
  437. + return Intercepted::kYes;
  438. }
  439. static void EnvEnumerator(const PropertyCallbackInfo<Array>& info) {
  440. @@ -417,9 +427,9 @@ static void EnvEnumerator(const PropertyCallbackInfo<Array>& info) {
  441. env->env_vars()->Enumerate(env->isolate()));
  442. }
  443. -static void EnvDefiner(Local<Name> property,
  444. - const PropertyDescriptor& desc,
  445. - const PropertyCallbackInfo<Value>& info) {
  446. +static Intercepted EnvDefiner(Local<Name> property,
  447. + const PropertyDescriptor& desc,
  448. + const PropertyCallbackInfo<void>& info) {
  449. Environment* env = Environment::GetCurrent(info);
  450. if (desc.has_value()) {
  451. if (!desc.has_writable() ||
  452. @@ -430,6 +440,7 @@ static void EnvDefiner(Local<Name> property,
  453. "configurable, writable,"
  454. " and enumerable "
  455. "data descriptor");
  456. + return Intercepted::kYes;
  457. } else if (!desc.configurable() ||
  458. !desc.enumerable() ||
  459. !desc.writable()) {
  460. @@ -438,6 +449,7 @@ static void EnvDefiner(Local<Name> property,
  461. "configurable, writable,"
  462. " and enumerable "
  463. "data descriptor");
  464. + return Intercepted::kYes;
  465. } else {
  466. return EnvSetter(property, desc.value(), info);
  467. }
  468. @@ -447,12 +459,14 @@ static void EnvDefiner(Local<Name> property,
  469. "'process.env' does not accept an"
  470. " accessor(getter/setter)"
  471. " descriptor");
  472. + return Intercepted::kYes;
  473. } else {
  474. THROW_ERR_INVALID_OBJECT_DEFINE_PROPERTY(env,
  475. "'process.env' only accepts a "
  476. "configurable, writable,"
  477. " and enumerable "
  478. "data descriptor");
  479. + return Intercepted::kYes;
  480. }
  481. }
  482. diff --git a/src/node_external_reference.h b/src/node_external_reference.h
  483. index c4aba23510872d66b58a1adc88cdd1ee85a86cfe..6d9988810b951771064de523bc20aaf389a9c08a 100644
  484. --- a/src/node_external_reference.h
  485. +++ b/src/node_external_reference.h
  486. @@ -66,16 +66,17 @@ class ExternalReferenceRegistry {
  487. V(v8::FunctionCallback) \
  488. V(v8::AccessorNameGetterCallback) \
  489. V(v8::AccessorNameSetterCallback) \
  490. - V(v8::GenericNamedPropertyDefinerCallback) \
  491. - V(v8::GenericNamedPropertyDeleterCallback) \
  492. - V(v8::GenericNamedPropertyEnumeratorCallback) \
  493. - V(v8::GenericNamedPropertyQueryCallback) \
  494. - V(v8::GenericNamedPropertySetterCallback) \
  495. - V(v8::IndexedPropertySetterCallback) \
  496. - V(v8::IndexedPropertyDefinerCallback) \
  497. - V(v8::IndexedPropertyDeleterCallback) \
  498. - V(v8::IndexedPropertyQueryCallback) \
  499. - V(v8::IndexedPropertyDescriptorCallback) \
  500. + V(v8::NamedPropertyGetterCallback) \
  501. + V(v8::NamedPropertyDefinerCallback) \
  502. + V(v8::NamedPropertyDeleterCallback) \
  503. + V(v8::NamedPropertyEnumeratorCallback) \
  504. + V(v8::NamedPropertyQueryCallback) \
  505. + V(v8::NamedPropertySetterCallback) \
  506. + V(v8::IndexedPropertyGetterCallbackV2) \
  507. + V(v8::IndexedPropertySetterCallbackV2) \
  508. + V(v8::IndexedPropertyDefinerCallbackV2) \
  509. + V(v8::IndexedPropertyDeleterCallbackV2) \
  510. + V(v8::IndexedPropertyQueryCallbackV2) \
  511. V(const v8::String::ExternalStringResourceBase*)
  512. #define V(ExternalReferenceType) \