Have you ever written Node.js code that counts on the implementation specific
Object behavior that mantains the insertion order of properties?

It could be useful in configuration, for example, to specify fallbacks if the
first choice isn't available.

    var conf = { database: { pg: "psql://localhost/database"
                           , mysql: "mysql://localhost/database" } };

    for (var type in conf.database) {
      try {
        useDatabase(require(type), conf.database[type]);
      } catch (e) {
        if (e.code != 'MODULE_NOT_FOUND') throw e;  
      }
    }

Great idea or *Greatest* idea?

Possibly related: http://code.google.com/p/v8/issues/detail?id=164

--
Alan Gutierrez - http://twitter.com/bigeasy - http://github.com/bigeasy

-- 
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 nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en

Reply via email to