mherkender / lua.js

An ECMAscript framework to compile and run Lua code, allowing Lua to run in a browser or in Flash
http://blog.brokenfunction.com/
600 stars 73 forks source link

Compatibility for Node v10 #42

Closed nomaed closed 5 years ago

nomaed commented 5 years ago

Builds fail with Node v10+ due to an exception in src/build_lua_parser.js when calling fs.writeFile() without a callback at the 3rd argument.

In Node versions before v7, it was allowed not to pass a callback but this was deprecated in Node v7 and completely removed in Node v10. While with v7, v8 and v9 skipping a callback would only issue a deprecation warning, v10 finalised the deprecations and it now throws an exception.

I updated the call to use fs.writeFileSync() instead, because it does not expect a callback and there was no special error handling in the code anyhow.