1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 21:08:12 +00:00

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

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