This repository has been archived by the owner on Apr 22, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 7.3k
Make process.env less weird #3521
Milestone
Comments
@isaacs Had to revert because master was completely broken by it. |
For the record, it was making node fail at startup.
|
ghost
assigned isaacs
Jun 29, 2012
Wow, that's weird. How do you get it to blow up like that? |
That is, is this a bug in V8's AccessorInfo stuff, or did I do something stupid like let the info->Data() get GC'd? |
isaacs
added a commit
that referenced
this issue
Jul 19, 2012
* nextTick: Handle tick callbacks before any other I/O (isaacs) * Enable color customization of `util.inspect` (Pavel Lang) * tls: Speed and memory improvements (Fedor Indutny) * readline: Use one history item for reentered line (Vladimir Beloborodov) * punycode: update to v1.1.1 (Mathias Bynens) * Fix #3521 Make process.env more like a regular Object (isaacs)
isaacs
added a commit
that referenced
this issue
Jul 20, 2012
* nextTick: Handle tick callbacks before any other I/O (isaacs) * Enable color customization of `util.inspect` (Pavel Lang) * tls: Speed and memory improvements (Fedor Indutny) * readline: Use one history item for reentered line (Vladimir Beloborodov) * punycode: update to v1.1.1 (Mathias Bynens) * Fix #3521 Make process.env more like a regular Object (isaacs)
isaacs
added a commit
that referenced
this issue
Jul 20, 2012
* punycode: update to v1.1.1 (Mathias Bynens) * c-ares: upgrade to 1.9.0 (Saúl Ibarra Corretgé) * dns: ignore rogue DNS servers reported by windows (Saúl Ibarra Corretgé) * unix: speed up uv_async_send() (Ben Noordhuis) * darwin: get cpu model correctly on mac (Xidorn Quan) * nextTick: Handle tick callbacks before any other I/O (isaacs) * Enable color customization of `util.inspect` (Pavel Lang) * tls: Speed and memory improvements (Fedor Indutny) * readline: Use one history item for reentered line (Vladimir Beloborodov) * Fix #3521 Make process.env more like a regular Object (isaacs)
dscape
added a commit
to dscape/node
that referenced
this issue
Sep 7, 2012
* 'master' of git://github.com/joyent/node: (143 commits) tls: use slab allocator tls: make tls a little bit faster readline: Use one history item for reentered line punycode: update to v1.1.1 tools: update gyp to r1426 deps: upgrade libuv to 5031a5b build: rename strict_aliasing to node_no_strict_aliasing build: disable -fstrict-aliasing for any gcc < 4.6.0 build: detect cc version with -dumpversion deps: upgrade libuv to cc1b3de doc: document setTimeout / setInterval behavior build: handle output of localized gcc or clang build: rename openssl configure switches deps: upgrade libuv to 3b8c0da doc: fs.lchmod() is only available on OS X Blog post about 0.8.1 Re-apply commit e307468. Revert "Fix nodejs#3521 Use an object as the process.env proto" 2012.06.29, Version 0.8.1 (stable) blog: Require posts to have a date ...
rochoa
added a commit
to CartoDB/node-mapnik
that referenced
this issue
Sep 24, 2014
…oesn't work like a proper JS object. ``` $ node -v v0.8.28 $ node > typeof process.env 'object' > typeof process.env.hasOwnProperty 'undefined' ``` See: nodejs/node-v0.x-archive#3521
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
The
process.env
object is a bit weird. It doesn't do prototypical inheritance at all, though its__proto__
member evaluates to an object. What's worse, it reports errors in these cases really strangely:The historical reason for this is that process.env is actually a proxy object that calls getenv and setenv behind the scenes. This is important, because it provides a way to interact with addons that may be running in the same process (but not in the V8 runtime.) If they call
setenv
then the results should be visible on this object.However, the EnvSetter and EnvGetter functions should treat
__proto__
differently, and should use the Object.prototype as the prototype, so that process.env behaves more like a regular JavaScript object.Also, whatever is causing that
#<error>
in the TypeError has got to go. It should report its[[Class]]
value asobject Environment
or some such.This cannot be done in Node v0.8, since it is a behavior change.
The text was updated successfully, but these errors were encountered: