rapscallion icon indicating copy to clipboard operation
rapscallion copied to clipboard

babel-plugin-server: spread attributes

Open shuhei opened this issue 7 years ago • 3 comments

babel-plugin-server throws an error on spread attributes.

A minimum test case:

$ echo '<Foo {...props} />;' | ./node_modules/.bin/babel --plugins ./src/transform/server
TypeError: unknown: Cannot read property 'name' of undefined
    at objExpr.properties.forEach.property (/Users/shuhei/work/js/rapscallion/src/transform/server.js:198:21)
    at Array.forEach (native)
    at objectExpressionToObject (/Users/shuhei/work/js/rapscallion/src/transform/server.js:197:22)
    at PluginPass.exit (/Users/shuhei/work/js/rapscallion/src/transform/server.js:27:21)
    at newFn (/Users/shuhei/work/js/rapscallion/node_modules/babel-traverse/lib/visitors.js:276:21)
    at NodePath._call (/Users/shuhei/work/js/rapscallion/node_modules/babel-traverse/lib/path/context.js:76:18)
    at NodePath.call (/Users/shuhei/work/js/rapscallion/node_modules/babel-traverse/lib/path/context.js:48:17)
    at NodePath.visit (/Users/shuhei/work/js/rapscallion/node_modules/babel-traverse/lib/path/context.js:117:8)
    at TraversalContext.visitQueue (/Users/shuhei/work/js/rapscallion/node_modules/babel-traverse/lib/context.js:150:16)
    at TraversalContext.visitSingle (/Users/shuhei/work/js/rapscallion/node_modules/babel-traverse/lib/context.js:108:19)

shuhei avatar Apr 12 '17 22:04 shuhei

would be cool to have this feature working (having the same behavior)

veiico avatar Jun 23 '17 11:06 veiico

Alright, this is next in my queue.

divmain avatar Jun 30 '17 01:06 divmain

Any news on this ?

dorian-marchal avatar Aug 09 '17 16:08 dorian-marchal