mirror of https://github.com/vitalif/phantomjs
Fix segfault when using e.g. console.error
When console.error was called, there was a segfault because it was treated as an uncaught exception, but did not have the correct stack trace information (I am not sure why, but still...) Now that we are generating the stackTrace in WebCore::reportException, the MessageType gets set correctly, so we can use this to differentiate between uncaught exceptions and other messages. https://code.google.com/p/phantomjs/issues/detail?id=471.6
parent
c3c65df12d
commit
439a58eaee
|
@ -302,9 +302,7 @@ void ChromeClientQt::addMessageToConsole(MessageSource src, MessageType type, Me
|
|||
QString x = message;
|
||||
QString y = sourceID;
|
||||
|
||||
// the MessageType value isn't useful - it will be LogMessageType for both errors
|
||||
// and log messages.
|
||||
if (level == ErrorMessageLevel) {
|
||||
if (src == JSMessageSource && type == UncaughtExceptionMessageType && level == ErrorMessageLevel) {
|
||||
QString stack = callStack->buildInspectorArray()->toJSONString();
|
||||
m_webPage->javaScriptError(x, lineNumber, y, stack);
|
||||
} else {
|
||||
|
|
Loading…
Reference in New Issue