Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
process.env.hasOwnProperty
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  Messages 26 - 38 of 38 - Collapse all  -  Translate all to Translated (View all originals) < Older 
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Isaac Schlueter  
View profile  
 More options Jun 26 2012, 5:34 pm
From: Isaac Schlueter <i...@izs.me>
Date: Tue, 26 Jun 2012 14:34:27 -0700
Local: Tues, Jun 26 2012 5:34 pm
Subject: Re: [nodejs] process.env.hasOwnProperty
Bert,

I'm with you on setenv/getenv being better.  Maybe we can add those
also, and those who value correctness will use them.

In the meantime,
https://github.com/joyent/node/commit/e3074689f501eea413c29b99defac29...
fixes 90% of the weirdness.  Having process.env behave like an object
is indeed too damn convenient, but if we're going to do that, we
should accept that it's worth giving up a slight amount of correctness
in exchange for convenience.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Brandon Benvie  
View profile   Translate to Translated (View Original)
 More options Jun 26 2012, 9:45 pm
From: Brandon Benvie <brandon.ben...@gmail.com>
Date: Tue, 26 Jun 2012 18:45:38 -0700 (PDT)
Local: Tues, Jun 26 2012 9:45 pm
Subject: Re: [nodejs] process.env.hasOwnProperty

What this really indicates is, given a time machine, is that process.env
should have been implemented as get and set functions.
Object.prototype.getOwnProperty.call(obj, key) will work correctly on any
JS object, and these days it'll actually work correctly on most/all DOM
objects in a browser. So even setting the object as having no prototype
doesn't really solve the problem. The problem is that it's not a JS object
in any sense of the word, nor has an API that fulfills the contracts that
JS objects are supposed to fill.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Brandon Benvie  
View profile  
 More options Jun 26 2012, 9:50 pm
From: Brandon Benvie <brandon.ben...@gmail.com>
Date: Tue, 26 Jun 2012 18:50:03 -0700 (PDT)
Local: Tues, Jun 26 2012 9:50 pm
Subject: Re: [nodejs] process.env.hasOwnProperty

(oh Bert said most of that)


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Rick Waldron  
View profile   Translate to Translated (View Original)
 More options Jun 26 2012, 10:00 pm
From: Rick Waldron <waldron.r...@gmail.com>
Date: Tue, 26 Jun 2012 22:00:22 -0400
Local: Tues, Jun 26 2012 10:00 pm
Subject: Re: [nodejs] process.env.hasOwnProperty

I've been following this conversation closely, but one thing that I'm still unclear about is _why_ process.env not a JS object (by new Object definition, that is).

There are some obvious guesses, but I'm mostly interested in actual documentation or historical fact, and not at all interested in opinion or more guesses - thanks!

-Rick


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Ben Noordhuis  
View profile  
 More options Jun 26 2012, 10:23 pm
From: Ben Noordhuis <i...@bnoordhuis.nl>
Date: Wed, 27 Jun 2012 04:23:35 +0200
Local: Tues, Jun 26 2012 10:23 pm
Subject: Re: [nodejs] process.env.hasOwnProperty

On Wed, Jun 27, 2012 at 4:00 AM, Rick Waldron <waldron.r...@gmail.com> wrote:
> I've been following this conversation closely, but one thing that I'm still
> unclear about is _why_ process.env not a JS object (by new Object
> definition, that is).

> There are some obvious guesses, but I'm mostly interested in actual
> documentation or historical fact, and not at all interested in opinion or
> more guesses - thanks!

Because it's not. It's a front for a bunch of libc functions. It just
looks like an object, mostly.

Here is the original commit[1]. Before that, process.env was a simple
copy of the environment (granted, as a pure JS object). I didn't want
to break the interface so I hacked up the thing we have today.

[1] https://github.com/joyent/node/commit/b4def48


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Rick Waldron  
View profile   Translate to Translated (View Original)
 More options Jun 26 2012, 11:40 pm
From: Rick Waldron <waldron.r...@gmail.com>
Date: Tue, 26 Jun 2012 23:40:33 -0400
Local: Tues, Jun 26 2012 11:40 pm
Subject: Re: [nodejs] process.env.hasOwnProperty

Thanks for info - certainly appreciated

Rick


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Brandon Benvie  
View profile   Translate to Translated (View Original)
 More options Jun 28 2012, 11:08 am
From: Brandon Benvie <brandon.ben...@gmail.com>
Date: Thu, 28 Jun 2012 08:08:58 -0700 (PDT)
Local: Thurs, Jun 28 2012 11:08 am
Subject: Re: [nodejs] process.env.hasOwnProperty

Just as a distraction from work I should be doing instead, I made a module
that exports the EnvGetter, EnvSetter, EnvEnumerator, and EnvDeleter as
functions. It also optionally, if Proxy is available, exports an
Environment constructor that creates objects that are similar to
process.env but more closely follow semantics of real objects. I may expand
it to support management of env of other process, but this is more
complicated and for now it's just an experiment that sticks to node's
existing functionality.

https://github.com/Benvie/environment


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Isaac Schlueter  
View profile  
 More options Jun 28 2012, 11:30 pm
From: Isaac Schlueter <i...@izs.me>
Date: Thu, 28 Jun 2012 20:30:58 -0700
Local: Thurs, Jun 28 2012 11:30 pm
Subject: Re: [nodejs] process.env.hasOwnProperty
Brandon,

I like this!  It's a shame that it requires --harmony.  When/if Proxy
lands in our normal V8 by default, we should consider replacing
process.env with this.

On Thu, Jun 28, 2012 at 8:08 AM, Brandon Benvie


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Brandon Benvie  
View profile  
 More options Jun 29 2012, 10:46 pm
From: Brandon Benvie <brandon.ben...@gmail.com>
Date: Fri, 29 Jun 2012 19:46:52 -0700 (PDT)
Local: Fri, Jun 29 2012 10:46 pm
Subject: Re: [nodejs] process.env.hasOwnProperty

Yeah this is definitely one of those places where proxies show their real
value. Being able to represent a heap external interface without having to
leave JS except for the very minimum amount required. With the Direct
Proxies API it'll go from "doable" to "trivial" to implement virtual
objects that mostly obey the rules of regular objects and don't blow up if
you try to use that as a prototype or use some rarely used but normal JS
API (the amount of C++ modules that explode if you do something like
Object.getOwnPropertyNames(Object.getPrototypeOf(cplusplusModuleObject)) is
actually quite ridiculous).

An interesting use-case I want to try out is that of representing
near-synced objects between parent/child/sibling processes. process.env is
a good example here as well because it's not generally time critical, but
still useful... "near objecst". Something that is usually around a single
event loop turn away, because it's out of process or in a js external
memory storage, or not in the JS heap for whatever reason, but close enough
that the limitation is simply having to post a callback to get at it.

Sometimes these things are time critical and C++ apis support that, but
usually you just build/use an async API around it. These objects are close
enough though that with some creative synchronization a useful proxy
interface could be provided that is "close enough" to provide the best of
both worlds. A child's process process.env would be an example where the
gap could be bridged by a proxy that provided local in-heap access and was
semi-lazily synced as needed. This captures the best of both worlds I
think, offloading the need to treat an API as asynchronous without
resorting to those things which shall not be named.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Jorge  
View profile  
 More options Jun 30 2012, 2:14 am
From: Jorge <jo...@jorgechamorro.com>
Date: Sat, 30 Jun 2012 08:14:04 +0200
Local: Sat, Jun 30 2012 2:14 am
Subject: Re: [nodejs] process.env.hasOwnProperty
On 30/06/2012, at 04:46, Brandon Benvie wrote:

> (...) This captures the best of both worlds I think, offloading the need to treat an API as asynchronous without resorting to those things which shall not be named.

What, what? Which things?
--
Jorge.

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Brandon Benvie  
View profile  
 More options Jun 30 2012, 2:17 am
From: Brandon Benvie <brandon.ben...@gmail.com>
Date: Fri, 29 Jun 2012 23:17:59 -0700 (PDT)
Local: Sat, Jun 30 2012 2:17 am
Subject: Re: [nodejs] process.env.hasOwnProperty

"Unterminated string literals ಠ_ಠ


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Alan Gutierrez  
View profile  
 More options Jul 3 2012, 8:18 am
From: Alan Gutierrez <a...@prettyrobots.com>
Date: Tue, 03 Jul 2012 08:18:45 -0400
Local: Tues, Jul 3 2012 8:18 am
Subject: Re: [nodejs] process.env.hasOwnProperty
On 6/30/12 2:17 AM, Brandon Benvie wrote:

> "Unterminated string literals ಠ_ಠ

I don't understand this at all. I'd really appreciate a link, because
all Google talks about are errors. How are Unterminated string literals
"offloading the need to treat an API as asynchronous".

--
Alan Gutierrez - @bigeasy


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Brandon Benvie  
View profile  
 More options Jul 4 2012, 12:48 am
From: Brandon Benvie <brandon.ben...@gmail.com>
Date: Tue, 3 Jul 2012 21:48:25 -0700 (PDT)
Local: Wed, Jul 4 2012 12:48 am
Subject: Re: [nodejs] process.env.hasOwnProperty

Mission accomplished?"


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages < Older 
« Back to Discussions « Newer topic     Older topic »