bugGNU gettext - Bugs: bug #58407, JavaScript parser stops at...

 
 

You are not allowed to post comments on this tracker with your current authentication level.

bug #58407: JavaScript parser stops at template literal inside JSX tag

Submitted by:  whiteinge
Submitted on:  Wed 20 May 2020 02:06:00 AM UTC  
 
Category:  JavaScript Severity:  3 - Normal
Item Group:  None Status:  None
Privacy:  Public Assigned to:  None
Open/Closed:  Open

Wed 20 May 2020 02:06:00 AM UTC, original submission:  

Similar to bug #50920, the file parser stops when it encounters a JavaScript template literal inside of a JSX tag.

As a child of a tag:

const App = () => (
  <div>
    _('one');
    {`${'foo'}`}
    _('two');
  </div>
)

As an attribute inside a tag:

_('one');
<div className={`${'foo'}`} />
_('two');

Tested on 0.20.2.

Tested using: xgettext -o - template-literal-jsx-repro1.js

Expected output:

#: template-literal-jsx-repro1.js:3
msgid "one"
msgstr ""

#: template-literal-jsx-repro1.js:5
msgid "two"
msgstr ""

Actual output:

#: template-literal-jsx-repro1.js:3
msgid "one"
msgstr ""

whiteinge

 

Attached Files
file #49127:  template-literal-jsx-repro1.js added by whiteinge (84B - application/x-javascript)
file #49128:  template-literal-jsx-repro2.js added by whiteinge (51B - application/x-javascript)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by whiteinge (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

     

     

    Follow 2 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2020-05-20 whiteinge Attached File- => Added template-literal-jsx-repro1.js, #49127
        Attached File- => Added template-literal-jsx-repro2.js, #49128

    Back to the top


    Powered by Savane 3.7