| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -273,7 +273,7 @@ static void RegisterAsyncHookWrapper(const FunctionCallbackInfo<Value>& args) { | |||
| 273 | 273 | ||
| 274 | 274 | void IsEnabled(const FunctionCallbackInfo<Value>& args) { | |
| 275 | 275 | Environment* env = Environment::GetCurrent(args); | |
| 276 | - args.GetReturnValue().Set(InspectorEnabled(env)); | ||
| 276 | + args.GetReturnValue().Set(env->inspector_agent()->IsListening()); | ||
| 277 | 277 | } | |
| 278 | 278 | ||
| 279 | 279 | void Open(const FunctionCallbackInfo<Value>& args) { | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1,14 @@ | |||
| 1 | + const assert = require('assert'); | ||
| 2 | + const inspector = require('inspector'); | ||
| 3 | + | ||
| 4 | + | ||
| 5 | + assert.strictEqual(inspector.url(), undefined); | ||
| 6 | + inspector.open(0, undefined, false); | ||
| 7 | + assert(inspector.url().startsWith('ws://')); | ||
| 8 | + assert.throws(() => { | ||
| 9 | + inspector.open(0, undefined, false); | ||
| 10 | + }, { | ||
| 11 | + code: 'ERR_INSPECTOR_ALREADY_ACTIVATED' | ||
| 12 | + }); | ||
| 13 | + inspector.close(); | ||
| 14 | + assert.strictEqual(inspector.url(), undefined); | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1,21 @@ | |||
| 1 | + 'use strict'; | ||
| 2 | + | ||
| 3 | + const common = require('../common'); | ||
| 4 | + const assert = require('assert'); | ||
| 5 | + const { spawnSync } = require('child_process'); | ||
| 6 | + const fixtures = require('../common/fixtures'); | ||
| 7 | + const tmpdir = require('../common/tmpdir'); | ||
| 8 | + | ||
| 9 | + common.skipIfInspectorDisabled(); | ||
| 10 | + common.skipIfWorker(); | ||
| 11 | + | ||
| 12 | + tmpdir.refresh(); | ||
| 13 | + | ||
| 14 | + | ||
| 15 | + let output = spawnSync(process.execPath, [fixtures.path('inspector-open.js')]); | ||
| 16 | + assert.strictEqual(output.status, 0); | ||
| 17 | + | ||
| 18 | + output = spawnSync(process.execPath, [fixtures.path('inspector-open.js')], { | ||
| 19 | + env: { ...process.env, NODE_V8_COVERAGE: tmpdir.path }, | ||
| 20 | + }); | ||
| 21 | + assert.strictEqual(output.status, 0); | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments