From e5b5b0f11fa2d51e8f2810e833dcae2f57c1635d Mon Sep 17 00:00:00 2001 From: Steven Wingfield Date: Sun, 12 Jul 2015 23:08:39 -0600 Subject: [PATCH] Add workaround for node issue 25266, where node seems to be generating 'compileError' events instead of 'afterCompile' events, which causes nodeclipse to miss the chance to process new scripts as they are pulled into a running application --- .../internal/v8native/DebuggerCommand.java | 1 + .../v8native/DefaultResponseHandler.java | 21 +++++++++++++++++++ 2 files changed, 22 insertions(+) diff --git a/chromedevtools/plugins/org.chromium.sdk/src/org/chromium/sdk/internal/v8native/DebuggerCommand.java b/chromedevtools/plugins/org.chromium.sdk/src/org/chromium/sdk/internal/v8native/DebuggerCommand.java index db37673e..995b3166 100755 --- a/chromedevtools/plugins/org.chromium.sdk/src/org/chromium/sdk/internal/v8native/DebuggerCommand.java +++ b/chromedevtools/plugins/org.chromium.sdk/src/org/chromium/sdk/internal/v8native/DebuggerCommand.java @@ -33,6 +33,7 @@ public enum DebuggerCommand { BREAK("break"), EXCEPTION("exception"), AFTER_COMPILE("afterCompile"), + COMPILE_ERROR("compileError"), SCRIPT_COLLECTED("scriptCollected"), ; diff --git a/chromedevtools/plugins/org.chromium.sdk/src/org/chromium/sdk/internal/v8native/DefaultResponseHandler.java b/chromedevtools/plugins/org.chromium.sdk/src/org/chromium/sdk/internal/v8native/DefaultResponseHandler.java index 64c1f3f5..924716e8 100644 --- a/chromedevtools/plugins/org.chromium.sdk/src/org/chromium/sdk/internal/v8native/DefaultResponseHandler.java +++ b/chromedevtools/plugins/org.chromium.sdk/src/org/chromium/sdk/internal/v8native/DefaultResponseHandler.java @@ -79,6 +79,27 @@ BreakpointProcessor get(DefaultResponseHandler instance) { command2EventProcessorGetter.put(DebuggerCommand.BREAK /* event */, bppGetter); command2EventProcessorGetter.put(DebuggerCommand.EXCEPTION /* event */, bppGetter); + // Nodeclipse Issue 189 / node issue 25266 + // Treat the "compileError" event as if it were + // the "afterCompile" event... + // This is a workaround for an apparent problem in node + // that was introduced in v0.11.14. The reported problem + // is that when a new script is required and compiled, + // the compileError event is generated instead of the + // afterCompile event. + // If this does in fact turn out to be a node issue, + // then presumably this workaround would be version-specific, + // and would only need to be activated for certain versions + // of node. + command2EventProcessorGetter.put(DebuggerCommand.COMPILE_ERROR /* event */, + new ProcessorGetter() { + @Override + AfterCompileProcessor get(DefaultResponseHandler instance) { + return instance.afterCompileProcessor; + } + }); + // Nodeclipse Issue 189 / node issue 25266 + command2EventProcessorGetter.put(DebuggerCommand.AFTER_COMPILE /* event */, new ProcessorGetter() { @Override