From 26834b052402aa22fa1d5d5d791f18e82dfb390b Mon Sep 17 00:00:00 2001 From: Ryan Dahl Date: Thu, 8 Sep 2011 13:30:19 -0700 Subject: [PATCH] Revert "vm context with accessors" This reverts commit 4527de8cba3bf5f107fcefcf43dbdaa308881ba4. Causes segfault in test/message/undefined_reference_in_new_context.js --- lib/vm.js | 13 ------ src/node_script.cc | 57 ++++++++++--------------- test/simple/test-vm-create-context-accessors.js | 26 ----------- 3 files changed, 22 insertions(+), 74 deletions(-) delete mode 100644 test/simple/test-vm-create-context-accessors.js diff --git a/lib/vm.js b/lib/vm.js index 45f0f59..d3348af 100644 --- a/lib/vm.js +++ b/lib/vm.js @@ -21,19 +21,6 @@ var binding = process.binding('evals'); -binding.NodeScript._setCloneMethod(function(source, target) { - Object.getOwnPropertyNames(source).forEach(function(key) { - try { - var desc = Object.getOwnPropertyDescriptor(source, key); - if (desc.value === source) desc.value = target; - - Object.defineProperty(target, key, desc); - } catch (e) { - // Catch sealed properties errors - } - }); -}); - exports.Script = binding.NodeScript; exports.createScript = function(code, ctx, name) { return new exports.Script(code, ctx, name); diff --git a/src/node_script.cc b/src/node_script.cc index 0195974..4f4153c 100644 --- a/src/node_script.cc +++ b/src/node_script.cc @@ -37,11 +37,9 @@ using v8::TryCatch; using v8::String; using v8::Exception; using v8::Local; -using v8::Null; using v8::Array; using v8::Persistent; using v8::Integer; -using v8::Function; using v8::FunctionTemplate; @@ -96,23 +94,10 @@ class WrappedScript : ObjectWrap { static Handle CompileRunInThisContext(const Arguments& args); static Handle CompileRunInNewContext(const Arguments& args); - static Handle SetCloneMethod(const Arguments& args); - Persistent