| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent c431725 commit 808de0d
2 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -423,6 +423,10 @@ Module.prototype._compile = function(content, filename) { | |||
| 423 | 423 | ||
| 424 | 424 | // Set breakpoint on module start | |
| 425 | 425 | if (filename === resolvedArgv) { | |
| 426 | + // Installing this dummy debug event listener tells V8 to start | ||
| 427 | + // the debugger. Without it, the setBreakPoint() fails with an | ||
| 428 | + // 'illegal access' error. | ||
| 429 | + global.v8debug.Debug.setListener(function() {}); | ||
| 426 | 430 | global.v8debug.Debug.setBreakPoint(compiledWrapper, 0, 0); | |
| 427 | 431 | } | |
| 428 | 432 | } | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -261,6 +261,12 @@ class ContextifyContext { | |||
| 261 | 261 | if (script_source.IsEmpty()) | |
| 262 | 262 | return; // Exception pending. | |
| 263 | 263 | Local<Context> debug_context = Debug::GetDebugContext(); | |
| 264 | + if (debug_context.IsEmpty()) { | ||
| 265 | + // Force-load the debug context. | ||
| 266 | + Debug::GetMirror(args.GetIsolate()->GetCurrentContext(), args[0]); | ||
| 267 | + debug_context = Debug::GetDebugContext(); | ||
| 268 | + CHECK(!debug_context.IsEmpty()); | ||
| 269 | + } | ||
| 264 | 270 | Environment* env = Environment::GetCurrent(args); | |
| 265 | 271 | ScopedEnvironment env_scope(debug_context, env); | |
| 266 | 272 | Context::Scope context_scope(debug_context); | |
| Back | FazBrowse Home | New Git URL |
0 commit comments