Update debugger detection to support Node v8.1+, and stop aborting if debugger messages are unrecognised.

This commit is contained in:
Steve Sanderson
2017-06-11 20:28:14 +01:00
parent 5e7bb0f5c5
commit a3bcc0d863

View File

@@ -381,12 +381,6 @@ namespace Microsoft.AspNetCore.NodeServices.HostingModels
{ {
OutputLogger.LogWarning(evt.Data); OutputLogger.LogWarning(evt.Data);
} }
else if (!initializationIsCompleted)
{
_connectionIsReadySource.SetException(
new InvalidOperationException("The Node.js process failed to initialize: " + evt.Data));
initializationIsCompleted = true;
}
else else
{ {
OnErrorDataReceived(UnencodeNewlines(evt.Data)); OnErrorDataReceived(UnencodeNewlines(evt.Data));
@@ -400,10 +394,11 @@ namespace Microsoft.AspNetCore.NodeServices.HostingModels
private static bool IsDebuggerMessage(string message) private static bool IsDebuggerMessage(string message)
{ {
return message.StartsWith("Debugger attached", StringComparison.OrdinalIgnoreCase) || return message.StartsWith("Debugger attached", StringComparison.Ordinal) ||
message.StartsWith("Debugger listening ", StringComparison.OrdinalIgnoreCase) || message.StartsWith("Debugger listening ", StringComparison.Ordinal) ||
message.StartsWith("To start debugging", StringComparison.OrdinalIgnoreCase) || message.StartsWith("To start debugging", StringComparison.Ordinal) ||
message.Equals("Warning: This is an experimental feature and could change at any time.", StringComparison.OrdinalIgnoreCase) || message.Equals("Warning: This is an experimental feature and could change at any time.", StringComparison.Ordinal) ||
message.Equals("For help see https://nodejs.org/en/docs/inspector", StringComparison.Ordinal) ||
message.Contains("chrome-devtools:"); message.Contains("chrome-devtools:");
} }