ExtendScript / extendscriptr

An NPM command line tool to compile modern javascript (es5 & es6) into executable extendscript (es3)
Do What The F*ck You Want To Public License
154 stars 15 forks source link

Prependify issue #26

Closed andyinabox closed 7 years ago

andyinabox commented 7 years ago

Hello there. I'm attempting to use this library in a basil.js project, and I'm getting the following error:

Running extendscriptr with following options:
--script: src/main.jsx
--output: index.jsx
--target: undefined (optional)
/[path]/node_modules/prependify/index.js:7
    text = text[Object.keys(text)[0]].join(' ')
                                      ^

TypeError: text[Object.keys(...)[0]].join is not a function
    at prependify (/[path]/node_modules/prependify/index.js:7:39)
    at Browserify.plugin (/[path]/node_modules/browserify/index.js:354:9)
    at /[path]/node_modules/browserify/index.js:100:14
    at Array.forEach (native)
    at new Browserify (/[path]/node_modules/browserify/index.js:99:44)
    at Browserify (/[path]/node_modules/browserify/index.js:39:47)
    at Object.<anonymous> (/[path]/node_modules/extendscriptr/index.js:39:9)
    at Module._compile (module.js:571:32)
    at Object.Module._extensions..js (module.js:580:10)
    at Module.load (module.js:488:32)

(I replaced the actual project path with [path] for privacy reasons)

Any ideas?

ff6347 commented 7 years ago

Hi @andyinabox can you provide some code so we can test this?

andyinabox commented 7 years ago

@fabianmoronzirfas I'm actually finding that it errors even when parsing an empty file. But here's some example code:

#includepath "../node_modules/";
#include "basiljs/basil.js";

function draw() {

  b.doc();
  b.text("Hello World", 100, 100, 200, 50);

}

b.go();