treycordova / nativejsx

JSX to native DOM API transpilation. :yellow_heart: <div> ⟹ document.createElement('div')!

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

String literal as object property name fails (TypeError: base[type] is not a function)

VladimirShugaev opened this issue · comments

version 4.2.0 fails to process files with string literal as object property name

Create a test.js file with content:

const test = {
  ok: null,
  'no-ok': null,
};

Try processing it

nativejsx test.js --output ./here

Results in error:

nativejsx/node_modules/acorn/dist/walk.js:29
    base[type](node, st, c)
              ^

TypeError: base[type] is not a function
...

My short investigation showed it is most probably caused by 5277090

I have fixed this bug, and create a pull request. #24
you can use my fork temporarily.

npm install https://github.com/j3l11234/nativejsx/archive/4.2.0.2.tar.gz --save-dev

@treycordova
I have the same problem.
The PR related to this has already been merged 2 months ago, so would you please release it?

This is released as 4.3.0! Sorry for the delay.