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
F13051710: D19860.id.diff
Fri, Apr 19, 4:09 AM
Unknown Object (File)
Wed, Apr 17, 10:21 AM
Unknown Object (File)
Sat, Apr 13, 4:13 PM
Unknown Object (File)
Fri, Apr 12, 8:55 PM
Unknown Object (File)
Thu, Apr 11, 9:07 AM
Unknown Object (File)
Fri, Apr 5, 7:42 PM
Unknown Object (File)
Tue, Apr 2, 5:14 PM
Unknown Object (File)
Mar 19 2024, 10:57 PM
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