Bug 142691 - [ES6] Implement ES6 template literals
Summary: [ES6] Implement ES6 template literals
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Yusuke Suzuki
URL:
Keywords:
Depends on: 144257
Blocks: 143183
  Show dependency treegraph
 
Reported: 2015-03-14 00:48 PDT by Yusuke Suzuki
Modified: 2015-04-27 03:21 PDT (History)
9 users (show)

See Also:


Attachments
WIP (30.84 KB, patch)
2015-03-26 14:42 PDT, Yusuke Suzuki
no flags Details | Formatted Diff | Diff
Patch (56.70 KB, patch)
2015-03-28 13:45 PDT, Yusuke Suzuki
no flags Details | Formatted Diff | Diff
Patch (57.39 KB, patch)
2015-03-28 13:56 PDT, Yusuke Suzuki
no flags Details | Formatted Diff | Diff
Patch (91.67 KB, patch)
2015-03-29 08:47 PDT, Yusuke Suzuki
no flags Details | Formatted Diff | Diff
Patch (98.69 KB, patch)
2015-04-02 05:06 PDT, Yusuke Suzuki
no flags Details | Formatted Diff | Diff
Patch (98.66 KB, patch)
2015-04-02 19:11 PDT, Yusuke Suzuki
no flags Details | Formatted Diff | Diff
Patch (98.67 KB, patch)
2015-04-18 06:58 PDT, Yusuke Suzuki
no flags Details | Formatted Diff | Diff
Patch (102.76 KB, patch)
2015-04-23 14:27 PDT, Yusuke Suzuki
darin: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Yusuke Suzuki 2015-03-14 00:48:58 PDT
[ES6] Implement ES6 template literals
Comment 1 Ryosuke Niwa 2015-03-21 02:26:31 PDT
See examples on https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/template_strings.

I think this will be mostly a parser change with an additional node for tagged template.
Comment 2 Yusuke Suzuki 2015-03-26 06:28:11 PDT
I'm working on this :)
Comment 3 Yusuke Suzuki 2015-03-26 14:42:45 PDT
Created attachment 249514 [details]
WIP

WIP. Not supporting tagged template literals yet
Comment 4 Yusuke Suzuki 2015-03-28 02:31:51 PDT
tagged templates require some global states and it makes the patch larger.
So in this bug, I'll implement template literals. And later, in subsequent patches, I'll implement tagged templates.
Comment 5 Yusuke Suzuki 2015-03-28 13:45:34 PDT
Created attachment 249671 [details]
Patch
Comment 6 WebKit Commit Bot 2015-03-28 13:47:03 PDT
Attachment 249671 [details] did not pass style-queue:


ERROR: Source/JavaScriptCore/parser/ParserTokens.h:99:  enum members should use InterCaps with an initial capital letter.  [readability/enum_casing] [4]
Total errors found: 1 in 28 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 7 Yusuke Suzuki 2015-03-28 13:56:31 PDT
Created attachment 249672 [details]
Patch
Comment 8 WebKit Commit Bot 2015-03-28 13:58:36 PDT
Attachment 249672 [details] did not pass style-queue:


ERROR: Source/JavaScriptCore/parser/ParserTokens.h:99:  enum members should use InterCaps with an initial capital letter.  [readability/enum_casing] [4]
Total errors found: 1 in 28 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 9 Ryosuke Niwa 2015-03-28 23:12:14 PDT
Comment on attachment 249672 [details]
Patch

Can we guard this feature inside an if-def or runtime flag so that we can disable if we need to just in the case?
Comment 10 Yusuke Suzuki 2015-03-29 02:32:11 PDT
(In reply to comment #9)
> Comment on attachment 249672 [details]
> Patch
> 
> Can we guard this feature inside an if-def or runtime flag so that we can
> disable if we need to just in the case?

Sure! So I'll make it behind the runtime flag, exposing only to inspector, JSC shell and test runner.
Comment 11 Yusuke Suzuki 2015-03-29 08:02:53 PDT
(In reply to comment #10)
> Sure! So I'll make it behind the runtime flag, exposing only to inspector,
> JSC shell and test runner.

After investigating about this, I've found that runtime flags belong to JSGlobalObject, but parser belongs to VM.
For example,
1. To create JSScriptRef in JSC API, we pass JSContextGroupRef, that can be casted to VM.
2. CodeCache belongs to VM

So we cannot use runtime flags for this case. I'll use compile time flags.
Comment 12 Yusuke Suzuki 2015-03-29 08:47:06 PDT
Created attachment 249685 [details]
Patch
Comment 13 WebKit Commit Bot 2015-03-29 08:48:58 PDT
Attachment 249685 [details] did not pass style-queue:


ERROR: Source/JavaScriptCore/parser/ParserTokens.h:99:  enum members should use InterCaps with an initial capital letter.  [readability/enum_casing] [4]
Total errors found: 1 in 40 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 14 Geoffrey Garen 2015-03-31 16:46:17 PDT
Comment on attachment 249685 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=249685&action=review

This patch looks good to me, but I think we need to find a way to share code before this lands.

> Source/JavaScriptCore/bytecompiler/NodesCodegen.cpp:241
> +    TemplateElementListNode* templateElementsTail = m_templateElements;
> +    for (auto templateExpressionsTail = m_templateExpressions; templateExpressionsTail; templateExpressionsTail = templateExpressionsTail->next(), templateElementsTail = templateElementsTail->next()) {

"templateExpressionsTail->next" is duplicated here.

By calling this value "tail", you imply that you're iterating in last-to-first order. But I think you intend to iterate in first-to-last order. So, I would just call this value "templateExpression".

> Source/JavaScriptCore/parser/Lexer.cpp:1226
> +// While JavaScriptCore's lexer accepts <LF><CR> (not <CR><LF>) sequence

I would just call this "the lexer". Comments in JavaScriptCore are about JavaScriptCore.

> Source/JavaScriptCore/parser/Lexer.cpp:1227
> +// as one line terminator and increment one line number,

increment => increments.

> Source/JavaScriptCore/parser/Lexer.cpp:1239
> +// However, line number saved in the lexer should be increment only once for <LF><CR>.

"...the line number saved in the lexer should increment only once..."

> Source/JavaScriptCore/parser/Lexer.cpp:1242
> +// When TemplateLiteral lexer encounters a line terminator, it notify to LineNumberAdder.

notify => notifies.

> Source/JavaScriptCore/parser/Lexer.cpp:1243
> +// LineNumberAdder maintains the status and increments line number when it's necessary.

line number => the line number

> Source/JavaScriptCore/parser/Lexer.cpp:1244
> +// For example, LineNumberAdder increments line number only once for <LF><CR> and <CR><LF>.

line number => the line number

> Source/JavaScriptCore/parser/Lexer.cpp:1347
> +            } else if (UNLIKELY(isLineTerminator(m_current))) {
> +                if (m_current == '\r') {
> +                    lineNumberAdder.add(m_current);
> +                    shift();
> +                    if (m_current == '\n') {
> +                        lineNumberAdder.add(m_current);
> +                        shift();
> +                    }
> +                } else {
> +                    lineNumberAdder.add(m_current);
> +                    shift();
> +                }
> +            } else if (m_current == 'x') {
> +                shift();
> +                if (!isASCIIHexDigit(m_current) || !isASCIIHexDigit(peek(1))) {
> +                    m_lexErrorMessage = ASCIILiteral("\\x can only be followed by a hex character sequence");
> +                    return StringCannotBeParsed;
> +                }
> +                T prev = m_current;
> +                shift();
> +                if (shouldBuildStrings)
> +                    record16(convertHex(prev, m_current));
> +                shift();
> +            } else if (m_current == 'u') {
> +                shift();
> +                UnicodeHexValue character = parseFourDigitUnicodeHex();
> +                if (character.isValid()) {
> +                    if (shouldBuildStrings)
> +                        record16(character.value());
> +                } else {
> +                    m_lexErrorMessage = ASCIILiteral("\\u can only be followed by a Unicode character sequence");
> +                    return character.valueType() == UnicodeHexValue::IncompleteHex ? StringUnterminated : StringCannotBeParsed;
> +                }
> +            } else if (isASCIIDigit(m_current)) {
> +                // The only valid numeric escape in strict mode is '\0', and this must not be followed by a decimal digit.
> +                int character1 = m_current;
> +                shift();
> +                if (character1 != '0' || isASCIIDigit(m_current)) {
> +                    m_lexErrorMessage = ASCIILiteral("The only valid numeric escape in strict mode is '\\0'");
> +                    return StringCannotBeParsed;
> +                }
> +                if (shouldBuildStrings)
> +                    record16(0);
> +            } else if (!atEnd()) {
> +                if (shouldBuildStrings)
> +                    record16(m_current);
> +                shift();
> +            } else {
> +                m_lexErrorMessage = ASCIILiteral("Unterminated string constant");
> +                return StringUnterminated;
> +            }

Can you write a helper function to share this code with parseString? This is a lot of code to duplicate, and it looks like the only difference we want is the line numbering difference, which is already pretty well factored out into the LineNumberAdder class.

> Source/JavaScriptCore/parser/Lexer.cpp:1403
> +        // TODO: raw is not implemented correctly yet.
> +        // Line terminator normalization is not done for raw.
> +        // When implementing TaggedTemplate which uses raw value, it should be fixed.

What is the consequence of the missing raw implementation? This comment should specify what happens when you parse a raw value.
Comment 15 Yusuke Suzuki 2015-04-02 05:03:30 PDT
Comment on attachment 249685 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=249685&action=review

Thank you for your review. I've commented. And I'll updated the patch.

>> Source/JavaScriptCore/bytecompiler/NodesCodegen.cpp:241
>> +    for (auto templateExpressionsTail = m_templateExpressions; templateExpressionsTail; templateExpressionsTail = templateExpressionsTail->next(), templateElementsTail = templateElementsTail->next()) {
> 
> "templateExpressionsTail->next" is duplicated here.
> 
> By calling this value "tail", you imply that you're iterating in last-to-first order. But I think you intend to iterate in first-to-last order. So, I would just call this value "templateExpression".

Ah, not duplicated. `templateExpressionsTail->next` and `templateElementsTail->next`. expressions and elements.
But, maybe it's confusing. I'll rename TemplateElement to TemplateString. It's clearer.

And agree to your suggestion about "tail". OK, I'll simply use "templateExpression" :D

>> Source/JavaScriptCore/parser/Lexer.cpp:1226
>> +// While JavaScriptCore's lexer accepts <LF><CR> (not <CR><LF>) sequence
> 
> I would just call this "the lexer". Comments in JavaScriptCore are about JavaScriptCore.

Thx! I've fixed it.

>> Source/JavaScriptCore/parser/Lexer.cpp:1227
>> +// as one line terminator and increment one line number,
> 
> increment => increments.

Done.

>> Source/JavaScriptCore/parser/Lexer.cpp:1239
>> +// However, line number saved in the lexer should be increment only once for <LF><CR>.
> 
> "...the line number saved in the lexer should increment only once..."

Done.

>> Source/JavaScriptCore/parser/Lexer.cpp:1242
>> +// When TemplateLiteral lexer encounters a line terminator, it notify to LineNumberAdder.
> 
> notify => notifies.

Done.

>> Source/JavaScriptCore/parser/Lexer.cpp:1243
>> +// LineNumberAdder maintains the status and increments line number when it's necessary.
> 
> line number => the line number

Done.

>> Source/JavaScriptCore/parser/Lexer.cpp:1244
>> +// For example, LineNumberAdder increments line number only once for <LF><CR> and <CR><LF>.
> 
> line number => the line number

Done.

>> Source/JavaScriptCore/parser/Lexer.cpp:1347
>> +            }
> 
> Can you write a helper function to share this code with parseString? This is a lot of code to duplicate, and it looks like the only difference we want is the line numbering difference, which is already pretty well factored out into the LineNumberAdder class.

Yes! I've extracted complicated escape code for \u, \x and \0 to parseComplexEscape.

>> Source/JavaScriptCore/parser/Lexer.cpp:1403
>> +        // When implementing TaggedTemplate which uses raw value, it should be fixed.
> 
> What is the consequence of the missing raw implementation? This comment should specify what happens when you parse a raw value.

Line terminator normalization (e.g. <CR> => <LF>) should be applied to both the raw and cooked representations.
But it doesn't do that for the raw representation.
So when parsing `<CR>`, <CR> appears in the raw representation of the result.

While non-tagged template literals don't use the raw representation, tagged templates use it.
So when implementing tagged templates, we should apply line terminator normalization to the raw representation.

OK! I've noted the above description here :D
Comment 16 Yusuke Suzuki 2015-04-02 05:06:53 PDT
Created attachment 249969 [details]
Patch
Comment 17 WebKit Commit Bot 2015-04-02 05:10:20 PDT
Attachment 249969 [details] did not pass style-queue:


ERROR: Source/JavaScriptCore/parser/ParserTokens.h:99:  enum members should use InterCaps with an initial capital letter.  [readability/enum_casing] [4]
Total errors found: 1 in 40 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 18 Yusuke Suzuki 2015-04-02 19:11:50 PDT
Created attachment 250029 [details]
Patch
Comment 19 WebKit Commit Bot 2015-04-02 19:14:46 PDT
Attachment 250029 [details] did not pass style-queue:


ERROR: Source/JavaScriptCore/parser/ParserTokens.h:99:  enum members should use InterCaps with an initial capital letter.  [readability/enum_casing] [4]
Total errors found: 1 in 40 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 20 Yusuke Suzuki 2015-04-08 10:02:04 PDT
Hi, the patch becomes ready for review.
Could you review this?
Comment 21 Yusuke Suzuki 2015-04-13 15:55:37 PDT
could you review this?
Comment 22 Yusuke Suzuki 2015-04-18 06:58:29 PDT
Created attachment 251090 [details]
Patch
Comment 23 Yusuke Suzuki 2015-04-18 07:00:16 PDT
Comment on attachment 251090 [details]
Patch

Could anyone review this patch? Just rebased the patch.
Comment 24 WebKit Commit Bot 2015-04-18 07:01:26 PDT
Attachment 251090 [details] did not pass style-queue:


ERROR: Source/JavaScriptCore/parser/ParserTokens.h:99:  enum members should use InterCaps with an initial capital letter.  [readability/enum_casing] [4]
Total errors found: 1 in 40 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 25 Yusuke Suzuki 2015-04-22 11:20:49 PDT
ping?
Comment 26 Joseph Pecoraro 2015-04-23 13:28:52 PDT
Comment on attachment 251090 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=251090&action=review

Very cool! I don't think I'm fully qualified to review this but I added some comments.

> Source/JavaScriptCore/jit/JITOpcodes.cpp:896
> +    linkSlowCase(iter);
> +    linkSlowCase(iter);

Should this only be called once?

> Source/JavaScriptCore/jit/JITOpcodes32_64.cpp:802
> +    linkSlowCase(iter);
> +    linkSlowCase(iter);

Should this only be called once?

> Source/JavaScriptCore/parser/Lexer.cpp:1320
> +            // Most common escape sequences first

Style: Comments should be sentences that end with a period.

> Source/JavaScriptCore/parser/Lexer.cpp:1399
> +        // While non-tagged template literals don't use the raw representation, tagged templates use the raw representaion.

Typo: "representaion" => "representation".

> Source/JavaScriptCore/parser/Lexer.cpp:1400
> +        // So line terminator nomralization should be applied to the raw representation when implementing tagged templates.

Typo: "nomralization" => "normalization"

> Source/JavaScriptCore/tests/stress/template-literal-syntax.js:51
> +testSyntaxError("`Hello${}", "SyntaxError: Unexpected token '}'");

I wonder if we can provide a better error message here. Something like: "SyntaxError: Template literal expression cannot be empty" may be more informative to users.

> Source/JavaScriptCore/tests/stress/template-literal.js:15
> +test(`Hello World`, "Hello World");

Tests I'd like to see but don't:

Empty template!

    test(``, "");

Nested templates:

    test(`Hello ${ `Cocoa` }`, "Hello Cocoa");
    test(`Hello ${ `Co${`c`}oa` }`, "Hello Cocoa");

Immediately adjacent template expressions, with empty intermediate template strings:

    test(`${"C"}${"o"}${"c"}${"o"}${"a"}`, "Cocoa");
Comment 27 Yusuke Suzuki 2015-04-23 13:43:36 PDT
Comment on attachment 251090 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=251090&action=review

Thank you for your comment! Very helpful.

>> Source/JavaScriptCore/jit/JITOpcodes.cpp:896
>> +    linkSlowCase(iter);
> 
> Should this only be called once?

In the JIT emitSlow op case, we need to call `linkSlowCase` the same times as times of calling `addSlowCase` in the fast op emitting function.
In this case, we called `addSlowCase` twice, so we need to call `linkSlowCase` twice.

But right. The current code is not good for readability. So I'll add comments about which `addSlowCase` is corresponding to the specific `linkSlowCase`.

>> Source/JavaScriptCore/jit/JITOpcodes32_64.cpp:802
>> +    linkSlowCase(iter);
> 
> Should this only be called once?

same as above.

>> Source/JavaScriptCore/parser/Lexer.cpp:1320
>> +            // Most common escape sequences first
> 
> Style: Comments should be sentences that end with a period.

Fixed! Thank you!

>> Source/JavaScriptCore/parser/Lexer.cpp:1399
>> +        // While non-tagged template literals don't use the raw representation, tagged templates use the raw representaion.
> 
> Typo: "representaion" => "representation".

Oops. Thank you. Fixed.

>> Source/JavaScriptCore/parser/Lexer.cpp:1400
>> +        // So line terminator nomralization should be applied to the raw representation when implementing tagged templates.
> 
> Typo: "nomralization" => "normalization"

Fixed.

>> Source/JavaScriptCore/tests/stress/template-literal-syntax.js:51
>> +testSyntaxError("`Hello${}", "SyntaxError: Unexpected token '}'");
> 
> I wonder if we can provide a better error message here. Something like: "SyntaxError: Template literal expression cannot be empty" may be more informative to users.

Sounds really nice!

>> Source/JavaScriptCore/tests/stress/template-literal.js:15
>> +test(`Hello World`, "Hello World");
> 
> Tests I'd like to see but don't:
> 
> Empty template!
> 
>     test(``, "");
> 
> Nested templates:
> 
>     test(`Hello ${ `Cocoa` }`, "Hello Cocoa");
>     test(`Hello ${ `Co${`c`}oa` }`, "Hello Cocoa");
> 
> Immediately adjacent template expressions, with empty intermediate template strings:
> 
>     test(`${"C"}${"o"}${"c"}${"o"}${"a"}`, "Cocoa");

That's really nice!
Comment 28 Yusuke Suzuki 2015-04-23 14:27:54 PDT
Created attachment 251490 [details]
Patch
Comment 29 WebKit Commit Bot 2015-04-23 14:31:26 PDT
Attachment 251490 [details] did not pass style-queue:


ERROR: Source/JavaScriptCore/parser/ParserTokens.h:99:  enum members should use InterCaps with an initial capital letter.  [readability/enum_casing] [4]
Total errors found: 1 in 40 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 30 Darin Adler 2015-04-26 12:22:19 PDT
Comment on attachment 251490 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=251490&action=review

> Source/JavaScriptCore/parser/Lexer.cpp:76
> +#if ENABLE(ES6_TEMPLATE_LITERAL_SYNTAX)
> +    CharacterBackQuote,
> +#endif

I would have made this unconditional; I think it does little harm to add one more character enum value even when this feature is off.

> Source/JavaScriptCore/parser/Lexer.cpp:1249
> +    m_buffer16.resize(0);

Always more efficient, I think, to use shrink(0) rather than resize(0).

> Source/JavaScriptCore/parser/Lexer.cpp:1273
> +template<typename T>

I would call these types CharacterType instead of T everywhere.

> Source/JavaScriptCore/parser/Lexer.cpp:1278
> +        , m_previous(0)

I would initialize this below rather than in the constructor.

> Source/JavaScriptCore/parser/Lexer.cpp:1290
> +        if ((character + m_previous) == '\n' + '\r')

Strange to use parentheses on one side of the expression and to on the other. If they are helpful on one side they are equally helpful on the other side. I would leave both sets out.

> Source/JavaScriptCore/parser/Lexer.cpp:1300
> +    T m_previous;

I’d initialize here in one of these two ways:

    T m_previous { };
    T m_previous { 0 };

> Source/JavaScriptCore/parser/Lexer.h:212
> +    enum class EscapeParseMode {
> +        Template,
> +        String
> +    };

I’d format this on a single line, not vertically.

> Source/JavaScriptCore/parser/NodeConstructors.h:105
> +        : m_next(nullptr)

Better to initialize m_next below instead of in all these constructors.

> Source/JavaScriptCore/parser/NodeConstructors.h:130
> +    inline TemplateStringListNode::TemplateStringListNode(TemplateStringListNode* prev, TemplateStringNode* node)

Why not write out the word “previous” instead of the abbreviation “prev”?

> Source/JavaScriptCore/parser/Nodes.h:440
> +        TemplateExpressionListNode* m_next;

Should initialize in one of these two ways:

    TemplateExpressionListNode* m_next { nullptr };
    TemplateExpressionListNode* m_next { };

I’d even do the same for fields like m_node that are always initialized “just in case”.

> ChangeLog:22
> +2015-04-23  Yusuke Suzuki  <utatane.tea@gmail.com>
> +
> +        [ES6] Implement ES6 template literals
> +        https://bugs.webkit.org/show_bug.cgi?id=142691
> +
> +        Reviewed by NOBODY (OOPS!).
> +
> +        * Source/cmake/WebKitFeatures.cmake:
> +        * Source/cmakeconfig.h.cmake:
> +
> +2015-04-18  Yusuke Suzuki  <utatane.tea@gmail.com>
> +
> +        [ES6] Implement ES6 template literals
> +        https://bugs.webkit.org/show_bug.cgi?id=142691
> +
> +        Reviewed by NOBODY (OOPS!).
> +
> +        Add ENABLE_ES6_TEMPLATE_LITERAL_SYNTAX compile time flag.
> +
> +        * Source/cmake/WebKitFeatures.cmake:
> +        * Source/cmakeconfig.h.cmake:
> +

Double change log here.
Comment 31 Yusuke Suzuki 2015-04-26 17:07:52 PDT
Comment on attachment 251490 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=251490&action=review

Thank you for your review!

>> Source/JavaScriptCore/parser/Lexer.cpp:76
>> +#endif
> 
> I would have made this unconditional; I think it does little harm to add one more character enum value even when this feature is off.

Right. I've dropped it.

>> Source/JavaScriptCore/parser/Lexer.cpp:1249
>> +    m_buffer16.resize(0);
> 
> Always more efficient, I think, to use shrink(0) rather than resize(0).

Changed resize(0) => shrink(0) in Lexer.cpp.

>> Source/JavaScriptCore/parser/Lexer.cpp:1273
>> +template<typename T>
> 
> I would call these types CharacterType instead of T everywhere.

Nice. Changed.

>> Source/JavaScriptCore/parser/Lexer.cpp:1290
>> +        if ((character + m_previous) == '\n' + '\r')
> 
> Strange to use parentheses on one side of the expression and to on the other. If they are helpful on one side they are equally helpful on the other side. I would leave both sets out.

Thanks! I've changed to use parentheses in both side.

>> Source/JavaScriptCore/parser/Lexer.cpp:1300
>> +    T m_previous;
> 
> I’d initialize here in one of these two ways:
> 
>     T m_previous { };
>     T m_previous { 0 };

Very nice C++11 feature!

>> Source/JavaScriptCore/parser/Lexer.h:212
>> +    };
> 
> I’d format this on a single line, not vertically.

Done.

>> Source/JavaScriptCore/parser/NodeConstructors.h:105
>> +        : m_next(nullptr)
> 
> Better to initialize m_next below instead of in all these constructors.

OK, use C++11 feature.

>> Source/JavaScriptCore/parser/NodeConstructors.h:130
>> +    inline TemplateStringListNode::TemplateStringListNode(TemplateStringListNode* prev, TemplateStringNode* node)
> 
> Why not write out the word “previous” instead of the abbreviation “prev”?

Fixed. Use "previous".

>> Source/JavaScriptCore/parser/Nodes.h:440
>> +        TemplateExpressionListNode* m_next;
> 
> Should initialize in one of these two ways:
> 
>     TemplateExpressionListNode* m_next { nullptr };
>     TemplateExpressionListNode* m_next { };
> 
> I’d even do the same for fields like m_node that are always initialized “just in case”.

ok, changed to `m_next { nullptr };`. And `m_node { nullptr }` "just in case".

>> ChangeLog:22
>> +
> 
> Double change log here.

Oops! Thanks.
Comment 32 Yusuke Suzuki 2015-04-26 17:28:44 PDT
Committed r183373: <http://trac.webkit.org/changeset/183373>
Comment 33 Csaba Osztrogonác 2015-04-27 02:54:34 PDT
(In reply to comment #32)
> Committed r183373: <http://trac.webkit.org/changeset/183373>

The new stress/template-literal-syntax.js test asserts everywhere,
see https://build.webkit.org/waterfall for details and please fix.
Comment 34 Yusuke Suzuki 2015-04-27 03:00:00 PDT
(In reply to comment #33)
> (In reply to comment #32)
> > Committed r183373: <http://trac.webkit.org/changeset/183373>
> 
> The new stress/template-literal-syntax.js test asserts everywhere,
> see https://build.webkit.org/waterfall for details and please fix.

Thank you. I'll investigate it.
Comment 35 Yusuke Suzuki 2015-04-27 03:11:47 PDT
Opened. https://bugs.webkit.org/show_bug.cgi?id=144257