From f94099f796a26920034159cf1adbdaef400c6756 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Sat, 14 Mar 2020 12:40:06 +0100 Subject: [PATCH] LibJS: Strip double-quote characters from StringLiteral tokens This is very hackish since I'm just doing it to make progress on something else. :^) --- Libraries/LibJS/Token.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Libraries/LibJS/Token.cpp b/Libraries/LibJS/Token.cpp index ff379d37db..894b53795e 100644 --- a/Libraries/LibJS/Token.cpp +++ b/Libraries/LibJS/Token.cpp @@ -216,6 +216,9 @@ double Token::double_value() const String Token::string_value() const { + if (m_value.length() >= 2 && m_value[0] == '"' && m_value[m_value.length() - 1]) { + return m_value.substring_view(1, m_value.length() - 2); + } // FIXME: unescape the string and remove quotes return m_value; }