From c49326e942d7cc21f78fe187020dce73befdd935 Mon Sep 17 00:00:00 2001 From: Konstantin Tokarev Date: Tue, 4 Jun 2019 22:44:55 +0300 Subject: Import WebKit commit 5ccca3a720f7c2251c4ac8b28f25bd73524081f0 Change-Id: Idfb37cd43929536d4c67d1fa5d8cb598e9c0ad7e Reviewed-by: Konstantin Tokarev --- Source/JavaScriptCore/parser/Parser.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'Source/JavaScriptCore/parser/Parser.h') 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); -- cgit v1.2.1