Page MenuHomePhabricator

Fix a bad method call signature throwing exceptions in newer Node
ClosedPublic

Authored by epriestley on Dec 10 2018, 7:43 PM.
Tags
None
Referenced Files
F19061095: D19860.id.diff
Nov 29 2025, 11:36 AM
F19055702: D19860.diff
Nov 28 2025, 6:07 PM
F18763723: D19860.id47423.diff
Oct 7 2025, 1:52 AM
F18671796: D19860.diff
Sep 25 2025, 5:19 AM
F18601354: D19860.diff
Sep 13 2025, 12:16 PM
F18574401: D19860.id47439.diff
Sep 10 2025, 10:37 AM
F18553138: D19860.id47439.diff
Sep 8 2025, 2:35 PM
F18515755: D19860.id.diff
Sep 5 2025, 11:52 AM
Subscribers
None

Details

Summary

Ref T13222. See PHI996. Ref T10743. For context, perhaps see T12171.

Node changed some signatures, behaviors, and error handling here in recent versions. As far as I can tell:

  • The script.runInNewContext(...) method has never taken a path parameter, and passing the path has always been wrong.
  • The script.runInNewContext(...) method started taking an [options] parameter at some point, and validating it, so the bad path parameter now throws.
  • vm.createScript(...) is "soft deprecated" but basically fine, and keeping it looks more compatible.

This seems like the smallest and most compatible correct change.

Test Plan

Under Node 10, started Aphlict. Before: fatal error on bad options parameter to runInNewContext() (expected dictionary). After: notification server starts.

Diff Detail

Repository
rP Phabricator
Lint
Lint Not Applicable
Unit
Tests Not Applicable