From 6f724e1563159fb332ed43068649958e99e7be28 Mon Sep 17 00:00:00 2001 From: Ben Noordhuis Date: Fri, 24 Nov 2017 00:13:44 +0100 Subject: [PATCH] lib,src: remove vm.runInDebugContext() The V8 API it is based on is deprecated and scheduled for removal later this year. Remove it. PR-URL: https://github.com/nodejs/node/pull/13295 Reviewed-By: Anna Henningsen Reviewed-By: Franziska Hinkelmann Reviewed-By: James M Snell Reviewed-By: Robert Jefe Lindstaedt Reviewed-By: Ruben Bridgewater Reviewed-By: Timothy Gu --- doc/api/deprecations.md | 5 +- doc/api/vm.md | 31 ----- lib/module.js | 4 - lib/vm.js | 15 --- src/node_contextify.cc | 33 ----- test/fixtures/vm-run-in-debug-context.js | 4 - test/parallel/test-util-inspect.js | 6 +- test/parallel/test-vm-debug-context.js | 123 ------------------ .../test-tick-processor-cpp-core.js | 4 +- .../test-tick-processor-preprocess-flag.js | 2 +- 10 files changed, 8 insertions(+), 219 deletions(-) delete mode 100644 test/fixtures/vm-run-in-debug-context.js delete mode 100644 test/parallel/test-vm-debug-context.js diff --git a/doc/api/deprecations.md b/doc/api/deprecations.md index 93baba97991c29..1353272439366d 100644 --- a/doc/api/deprecations.md +++ b/doc/api/deprecations.md @@ -600,10 +600,9 @@ a V8-inspector based CLI debugger available through `node inspect`. ### DEP0069: vm.runInDebugContext(string) -Type: Runtime +Type: End-of-Life -The DebugContext will be removed in V8 soon and will not be available in Node -10+. +DebugContext has been removed in V8 and is not available in Node 10+. *Note*: DebugContext was an experimental API. diff --git a/doc/api/vm.md b/doc/api/vm.md index 209302b450bc09..001e7b0a2387ff 100644 --- a/doc/api/vm.md +++ b/doc/api/vm.md @@ -334,36 +334,6 @@ console.log(util.inspect(sandbox)); // { globalVar: 1024 } ``` -## vm.runInDebugContext(code) - - -> Stability: 0 - Deprecated. An alternative is in development. - -* `code` {string} The JavaScript code to compile and run. - -The `vm.runInDebugContext()` method compiles and executes `code` inside the V8 -debug context. The primary use case is to gain access to the V8 `Debug` object: - -```js -const vm = require('vm'); -const Debug = vm.runInDebugContext('Debug'); -console.log(Debug.findScript(process.emit).name); // 'events.js' -console.log(Debug.findScript(process.exit).name); // 'internal/process.js' -``` - -*Note*: The debug context and object are intrinsically tied to V8's debugger -implementation and may change (or even be removed) without prior warning. - -The `Debug` object can also be made available using the V8-specific -`--expose_debug_as=` [command line option][]. - ## vm.runInNewContext(code[, sandbox][, options])