domenic / webidl-class-generator

Generates classes from WebIDL plus implementation code
BSD 2-Clause "Simplified" License
28 stars 1 forks source link

syntax error of strict mode #20

Open halton opened 8 years ago

halton commented 8 years ago
$ node scripts/generate-class.js < test/cases/html-hr-element.idl
/home/halton/work/projects/github/webidl-class-generator/scripts/generate-class.js:11
let input = "";
^^^

SyntaxError: Block-scoped declarations (let, const, function, class) not yet supported outside strict mode
    at exports.runInThisContext (vm.js:53:16)
    at Module._compile (module.js:374:25)
    at Object.Module._extensions..js (module.js:417:10)
    at Module.load (module.js:344:32)
    at Function.Module._load (module.js:301:12)
    at Function.Module.runMain (module.js:442:10)
    at startup (node.js:136:18)
    at node.js:966:3
arv commented 8 years ago

Either use a newer version of node or generate-class.js should inject a 'use strict' directive.

halton commented 8 years ago

Thanks for hint. My node version is v4.2.6, i'll try to update to v6 to give a try. Anyway, v4 is now LTS and recommended for most users (refer to nodejs.org), do you think this project will abondon v4 support?

halton commented 8 years ago

BTW, upgrading to node 6.x does fix this issue. I upload PR #21 for fixing this issue for node 4.x anyway.