From 0581afe531e5fa39d29c59ac5b3dcb323208375d Mon Sep 17 00:00:00 2001 From: Bert Belder Date: Fri, 29 Jun 2012 17:03:37 +0200 Subject: [PATCH] Revert "Fix #3521 Use an object as the process.env proto" The reverted commit caused a v8 assertion to trigger in debug mode. This reverts commit e3074689f501eea413c29b99defac29659a2b615. --- src/node.cc | 6 +++--- test/simple/test-process-env.js | 10 ---------- 2 files changed, 3 insertions(+), 13 deletions(-) diff --git a/src/node.cc b/src/node.cc index b19b447d2d..e0a0c72273 100644 --- a/src/node.cc +++ b/src/node.cc @@ -1959,8 +1959,8 @@ static Handle EnvGetter(Local property, return scope.Close(String::New(reinterpret_cast(buffer), result)); } #endif - // Not found. Fetch from prototype. - return info.Data().As()->Get(property); + // Not found + return Undefined(); } @@ -2210,7 +2210,7 @@ Handle SetupProcessObject(int argc, char *argv[]) { EnvQuery, EnvDeleter, EnvEnumerator, - Object::New()); + Undefined()); Local env = envTemplate->NewInstance(); process->Set(String::NewSymbol("env"), env); diff --git a/test/simple/test-process-env.js b/test/simple/test-process-env.js index 919d0d54ed..fdf35ba772 100644 --- a/test/simple/test-process-env.js +++ b/test/simple/test-process-env.js @@ -47,18 +47,8 @@ if (process.argv[2] == 'you-are-the-child') { // failed assertion results in process exiting with status code 1 assert.equal(false, 'NODE_PROCESS_ENV_DELETED' in process.env); assert.equal(42, process.env.NODE_PROCESS_ENV); - assert.equal('asdf', process.env.hasOwnProperty); - var hasOwnProperty = Object.prototype.hasOwnProperty; - var has = hasOwnProperty.call(process.env, 'hasOwnProperty'); - assert.equal(true, has); process.exit(0); } else { - assert.equal(Object.prototype.hasOwnProperty, process.env.hasOwnProperty); - var has = process.env.hasOwnProperty('hasOwnProperty'); - assert.equal(false, has); - - process.env.hasOwnProperty = 'asdf'; - process.env.NODE_PROCESS_ENV = 42; assert.equal(42, process.env.NODE_PROCESS_ENV);