Closed
Description
This unit test fails.
it('should handle parenthesis in expressions', function() {
var code = [
'/**',
' * @jsx React.DOM',
' */',
'<Component x={(a)} {...(b)} y={1} />;'
].join('\n');
var result = [
'/**',
' * @jsx React.DOM',
' */',
'Component({x: (a), ...(b), y: 1});'
].join('\n');
expect(transform(code).code).toBe(result);
});
Because this only steps past the inner expression: https://github.com/facebook/react/blob/master/vendor/fbtransform/transforms/xjs.js#L226-L227
The parenthesis is not it's own expression and therefore doesn't have a range. It's not possible to skip past the )
to insert the ,
after it.
Metadata
Metadata
Assignees
Labels
No labels