LibJS: Strip double-quote characters from StringLiteral tokens

This is very hackish since I'm just doing it to make progress on
something else. :^)
This commit is contained in:
Andreas Kling 2020-03-14 12:40:06 +01:00
parent c0e6234219
commit f94099f796
Notes: sideshowbarker 2024-07-19 08:18:57 +09:00

View file

@ -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;
}