Revert "Expose the V8 debug object process.debug"
authorRyan Dahl <ry@tinyclouds.org>
Wed, 4 Aug 2010 17:38:19 +0000 (10:38 -0700)
committerRyan Dahl <ry@tinyclouds.org>
Wed, 4 Aug 2010 17:38:19 +0000 (10:38 -0700)
This reverts commit d9fbb8a58071e339711e8c0ceeb31de5a645fd42.

lib/module.js
src/node.cc
src/node.js
test/simple/test-liveedit.js [deleted file]

index 9b0c4b0..72814a7 100644 (file)
@@ -420,8 +420,8 @@ Module.prototype._compile = function (content, filename) {
                   + "\n});";
 
       var compiledWrapper = process.compile(wrapper, filename);
-      if (filename === process.argv[1] && process._debugWaitConnect) {
-        process.debug.setBreakPoint(compiledWrapper, 0, 0);
+      if (filename === process.argv[1] && global.v8debug) {
+        global.v8debug.Debug.setBreakPoint(compiledWrapper, 0, 0);
       }
       compiledWrapper.apply(self.exports, [self.exports, require, self, filename, dirname]);
     } else {
index 1523c09..aae8a05 100644 (file)
@@ -1631,9 +1631,6 @@ static void Load(int argc, char *argv[]) {
   // who do not like how 'src/node.js' setups the module system but do like
   // Node's I/O bindings may want to replace 'f' with their own function.
 
-  process->Set(String::NewSymbol("_debugWaitConnect"),
-               node::debug_wait_connect ? True() : False());
-
   Local<Value> args[1] = { Local<Value>::New(process) };
 
   f->Call(global, 1, args);
@@ -1744,15 +1741,16 @@ int main(int argc, char *argv[]) {
   int v8argc = node::option_end_index;
   char **v8argv = argv;
 
-  // v8argv is a copy of argv up to the script file argument +2
-  // to expose the v8 debugger js object so that module.js can set
-  // a breakpoint on the first line of the startup script
-  v8argc += 2;
-  v8argv = new char*[v8argc];
-  memcpy(v8argv, argv, sizeof(argv) * node::option_end_index);
-  v8argv[node::option_end_index] = const_cast<char*>("--expose_debug_as");
-  v8argv[node::option_end_index + 1] = const_cast<char*>("v8debug");
-
+  if (node::debug_wait_connect) {
+    // v8argv is a copy of argv up to the script file argument +2 if --debug-brk
+    // to expose the v8 debugger js object so that module.js can set
+    // a breakpoint on the first line of the startup script
+    v8argc += 2;
+    v8argv = new char*[v8argc];
+    memcpy(v8argv, argv, sizeof(argv) * node::option_end_index);
+    v8argv[node::option_end_index] = const_cast<char*>("--expose_debug_as");
+    v8argv[node::option_end_index + 1] = const_cast<char*>("v8debug");
+  }
   V8::SetFlagsFromCommandLine(&v8argc, v8argv, false);
 
   // Ignore SIGPIPE
index 6d60113..70a2917 100644 (file)
@@ -233,9 +233,6 @@ global.console.assert = function(expression){
 
 global.Buffer = module.requireNative('buffer').Buffer;
 
-process.debug = global.v8debug.Debug;
-global.v8debug = undefined;
-
 process.exit = function (code) {
   process.emit("exit");
   process.reallyExit(code);
diff --git a/test/simple/test-liveedit.js b/test/simple/test-liveedit.js
deleted file mode 100644 (file)
index 6ba422f..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-common = require("../common");
-assert = require("assert");
-
-
-// This is a duplicate of deps/v8/test/mjsunit/debug-liveedit-1.js
-//  Just exercises the process.debug object.
-
-eval("var something1 = 25; "
-     + " function ChooseAnimal() { return          'Cat';          } "
-     + " ChooseAnimal.Helper = function() { return 'Help!'; }");
-
-assert.equal("Cat", ChooseAnimal());
-
-var script = process.debug.findScript(ChooseAnimal);
-
-var orig_animal = "Cat";
-var patch_pos = script.source.indexOf(orig_animal);
-var new_animal_patch = "Cap' + 'y' + 'bara";
-
-var change_log = new Array();
-process.debug.LiveEdit.TestApi.ApplySingleChunkPatch(script,
-                                                     patch_pos,
-                                                     orig_animal.length,
-                                                     new_animal_patch,
-                                                     change_log);
-
-assert.equal("Capybara", ChooseAnimal());