You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
src: disallow calling env-dependent methods during bootstrap
These cannot be preserved correctly in v8 snapshot. Currently
none of these are called during bootstrap, this adds assertions
to make sure future contributors do not accidentally call
these in the wrong time.
Consider this, on the machine that builds releases:
```
process.cwd(); # "/home/iojs/build/workspace/"
```
If `process.cwd()` is cached as in
#27224, when the user
downloads this binary to their machine:
```
$ cd ~/
$ pwd # "/User/foo"
$ node -p "process.cwd()" # "/home/iojs/build/workspace/"
```
This patch only adds checks in methods that get states from the
environment - it's not likely that the setters would be called
during bootstrap, and if they are called, we'll just ignore them
and whatever tests that test the change would fail when snapshot
is enabled. However the getters may be called in order
to persist information into strings and that would be harder
to catch (the test is only likely to test the format of these
strings which won't be useful).
PR-URL: #27234
Refs: #27224
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Ruben Bridgewater <[email protected]>
Reviewed-By: Ben Noordhuis <[email protected]>
0 commit comments