Changeset 203028 in webkit
- Timestamp:
- Jul 9, 2016, 12:33:28 AM (9 years ago)
- Location:
- trunk/Source/JavaScriptCore
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/ChangeLog
r203015 r203028 1 2016-07-09 Benjamin Poulain <bpoulain@apple.com> 2 3 [JSC] Fix the Template Raw Value of \ (escape) + LineTerminatorSequence 4 https://bugs.webkit.org/show_bug.cgi?id=159595 5 6 Reviewed by Yusuke Suzuki. 7 8 The spec (https://tc39.github.io/ecma262/#sec-static-semantics-tv-and-trv) 9 says: 10 "The TRV of LineContinuation::\LineTerminatorSequence is the sequence 11 consisting of the code unit value 0x005C followed by the code units 12 of TRV of LineTerminatorSequence." 13 14 We were not normalizing the LineTerminatorSequence in that case, but it should 15 be as it is the TRV of LineTerminatorSequence. 16 17 * parser/Lexer.cpp: 18 (JSC::Lexer<T>::parseTemplateLiteral): 19 * tests/stress/tagged-templates-raw-strings.js: 20 1 21 2016-07-08 Saam Barati <sbarati@apple.com> 2 22 -
trunk/Source/JavaScriptCore/parser/Lexer.cpp
r202768 r203028 1394 1394 shift(); 1395 1395 } else if (UNLIKELY(isLineTerminator(m_current))) { 1396 // Normalize <CR>, <CR><LF> to <LF>. 1396 1397 if (m_current == '\r') { 1398 if (shouldBuildStrings) { 1399 ASSERT_WITH_MESSAGE(rawStringStart != currentSourcePtr(), "We should have at least shifted the escape."); 1400 1401 if (rawStringsBuildMode == RawStringsBuildMode::BuildRawStrings) { 1402 m_bufferForRawTemplateString16.append(rawStringStart, currentSourcePtr() - rawStringStart); 1403 m_bufferForRawTemplateString16.append('\n'); 1404 } 1405 } 1406 1397 1407 lineNumberAdder.add(m_current); 1398 1408 shift(); … … 1401 1411 shift(); 1402 1412 } 1413 1414 rawStringStart = currentSourcePtr(); 1403 1415 } else { 1404 1416 lineNumberAdder.add(m_current); -
trunk/Source/JavaScriptCore/tests/stress/tagged-templates-raw-strings.js
r184337 r203028 54 54 55 55 testEval("Hello\\\n\r\rWorld", [ "Hello\\\n\n\nWorld" ]); 56 testEval("Hello\\\r\n\n\nWorld", [ "Hello\\\ r\n\n\nWorld" ]);56 testEval("Hello\\\r\n\n\nWorld", [ "Hello\\\n\n\nWorld" ]); 57 57 testEval("Hello\\\n\r\n\nWorld", [ "Hello\\\n\n\nWorld" ]); 58 58 testEval("Hello\\\n\r\r\nWorld", [ "Hello\\\n\n\nWorld" ]);
Note:
See TracChangeset
for help on using the changeset viewer.