Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parens () inside of {} causes a syntax error when passed through JSXTransformer #116

Closed
jeffreylin opened this issue Jun 20, 2013 · 3 comments

Comments

@jeffreylin
Copy link
Contributor

This happens in both JSXTransformer 0.3.0 and 0.3.2

Something like:

/** @jsx React.DOM */
      <div
        a={(1)}  // BAD: this works only if you remove the parens here.
        b={2}
      >
        hi2u!
      </div>

Gets transformed into:

/** @jsx React.DOM */
      React.DOM.div(
        {a:(1,)  // BAD: SYNTAX ERROR
        b:2}, null
      )

Test/demo case at:
http://jsfiddle.net/mvD4f/2/

I think this might be related to the {/* this fails currently */} issue at #82

@jeffmo
Copy link
Contributor

jeffmo commented Jun 21, 2013

I can confirm this works after the empty-xjs-expressions diff (which is coming as soon as I can coordinate with @zpao on pushing separate dependent repos -- which should be in the coming day or two I hope)

@zpao
Copy link
Member

zpao commented Jun 24, 2013

FYI: You should be safe to push that to esprima at any point now. Once it's there we can pull down the updated transform and update our esprima dependency rev.

@vjeux
Copy link
Contributor

vjeux commented Jul 21, 2013

It's now working :) Closing

@vjeux vjeux closed this as completed Jul 21, 2013
bvaughn added a commit to bvaughn/react that referenced this issue Aug 13, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants