`process.env` is not a real JS object. it's a stub for a chunk of C++
code. But by all means file an issue if you feel strongly about this,
we can probably fix it.
--
Job Board: http://jobs.nodejs.org/
Posting guidelines: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to nod...@googlegroups.com
To unsubscribe from this group, send email to
nodejs+un...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en
Object.create(null) objects are real JS objects and act like real JS objects.
On Jun 23, 2012, at 2:04 AM, Mikeal Rogers wrote:
> process.env should be a real js object, or at least act like one.
>
> if we have to i'd say we make process.env a getter and build a real js object from the C++ stub that is currently there.
>
> people should not be expected to know or distinguish between normal js objects and crazy things from C++.
>
> -Mikeal
>
> On Jun 22, 2012, at June 22, 20124:58 PM, Ben Noordhuis wrote:
>
>> On Fri, Jun 22, 2012 at 7:22 PM, Bert Belder <bertb...@gmail.com> wrote:
>>>
>>>
>>> On Friday, June 22, 2012 6:27:49 PM UTC+2, Ben Noordhuis wrote:
>>>>
>>>> `process.env` is not a real JS object. it's a stub for a chunk of C++
>>>> code. But by all means file an issue if you feel strongly about this,
>>>> we can probably fix it.
>>>
>>>
>>> I don't agree. People shouldn't rely on prototype methods of objects that
>>> are used as hash tables. Same story for the http headers object, parsed
>>> querystring arguments etc.
>>
>> Apparently Bert feels strongly about this. :-)
>>
>> --
>> Job Board: http://jobs.nodejs.org/
>> Posting guidelines: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
>> You received this message because you are subscribed to the Google
>> Groups "nodejs" group.
>> To post to this group, send email to nod...@googlegroups.com
>> To unsubscribe from this group, send email to
>> For more options, visit this group at
>> http://groups.google.com/group/nodejs?hl=en?hl=en
>
> --
> Job Board: http://jobs.nodejs.org/
> Posting guidelines: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
> You received this message because you are subscribed to the Google
> Groups "nodejs" group.
> To post to this group, send email to nod...@googlegroups.com
> To unsubscribe from this group, send email to
> For more options, visit this group at
> http://groups.google.com/group/nodejs?hl=en?hl=en
Object.create(null) objects are real JS objects and act like real JS objects.
On Jun 23, 2012, at 2:04 AM, Mikeal Rogers wrote:
> process.env should be a real js object, or at least act like one.
>
> if we have to i'd say we make process.env a getter and build a real js object from the C++ stub that is currently there.
>
> people should not be expected to know or distinguish between normal js objects and crazy things from C++.
>
> -Mikeal
>
> On Jun 22, 2012, at June 22, 20124:58 PM, Ben Noordhuis wrote:
>
>> On Fri, Jun 22, 2012 at 7:22 PM, Bert Belder <bertb...@gmail.com> wrote:
>>>
>>>
>>> On Friday, June 22, 2012 6:27:49 PM UTC+2, Ben Noordhuis wrote:
>>>>
>>>> `process.env` is not a real JS object. it's a stub for a chunk of C++
>>>> code. But by all means file an issue if you feel strongly about this,
>>>> we can probably fix it.
>>>
>>>
>>> I don't agree. People shouldn't rely on prototype methods of objects that
>>> are used as hash tables. Same story for the http headers object, parsed
>>> querystring arguments etc.
>>
>> Apparently Bert feels strongly about this. :-)
>>
>> --
>> Job Board: http://jobs.nodejs.org/
>> Posting guidelines: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
>> You received this message because you are subscribed to the Google
>> Groups "nodejs" group.
>> To post to this group, send email to nod...@googlegroups.com
>> To unsubscribe from this group, send email to
>> nodejs+unsubscribe@googlegroups.com
>> For more options, visit this group at
>> http://groups.google.com/group/nodejs?hl=en?hl=en
>
> --
> Job Board: http://jobs.nodejs.org/
> Posting guidelines: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
> You received this message because you are subscribed to the Google
> Groups "nodejs" group.
> To post to this group, send email to nod...@googlegroups.com
> To unsubscribe from this group, send email to
> nodejs+unsubscribe@googlegroups.com
Yep. And I always steer people away from instanceof. It's too unpredictable and often unnecessary.I'm in agreement with Mikeal. As often as possible you should try to make node host objects behave like js objects.
You and Bert are technically correct but what you're correct about doesn't matter.
Should node cause an exception on accessing this prototype which many people expect to be there?
The answer is obviously "no" only because it's much easier to make it not a problem that anyone ever sees than it is to explain this to everyone who gets this error.
If you reply with another email explaining to me how JavaScript works I'm seriously going to flip out.
-Mikeal
On Tuesday, June 26, 2012 at 9:50 PM, Brandon Benvie wrote:
(oh Bert said most of that)
--