summaryrefslogtreecommitdiffstats
path: root/Source/JavaScriptCore/parser/Parser.h
diff options
context:
space:
mode:
Diffstat (limited to 'Source/JavaScriptCore/parser/Parser.h')
-rw-r--r--Source/JavaScriptCore/parser/Parser.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/Source/JavaScriptCore/parser/Parser.h b/Source/JavaScriptCore/parser/Parser.h
index 02a726a56..bce94ba25 100644
--- a/Source/JavaScriptCore/parser/Parser.h
+++ b/Source/JavaScriptCore/parser/Parser.h
@@ -1114,7 +1114,10 @@ private:
void setErrorMessage(const String& message)
{
+ ASSERT_WITH_MESSAGE(!message.isEmpty(), "Attempted to set the empty string as an error message. Likely caused by invalid UTF8 used when creating the message.");
m_errorMessage = message;
+ if (m_errorMessage.isEmpty())
+ m_errorMessage = ASCIILiteral("Unparseable script");
}
NEVER_INLINE void logError(bool);