Releases: MatAtBread/nodent
Fix block scoped `const`.
- Test both strict and non-strict modes (nodent-compiler)
- Avoid deprecation warning in NodeJS 10 for
new Buffer()
- Fix regression in 3.2.5 for
var
declared in loop bodies - Treat
const
as block scoped by default (pre-ES6 implementations usually treated const as function scoped). See MatAtBread/nodent-transform@5fa3d01
More `try-catch` fixes
- Fix issue where
catch
body was incompletely transformed (see #109) - Fix issue where unreachable continuation generated an illegal Identifer after try-catch (see MatAtBread/fast-async#56)
Fix the lifetime of let and const loop variable declarations
Fix the lifetime of let and const loop variable declarations
The previous implementation correctly limited the scope, but not the lifetime of the loop declarations, meaning they would be re-used if referenced in a callback.
Move compiler-only tests into a different sub-directory since they are now duplicates of the tests in nodent-compiler.
Refactor for nodent-compiler and nodent-transformer
v3.2.0 Refactor
Use nodent-compiler @3.2.0
, which in turn uses the [email protected]
, which is the base AST transformer (with no parser or code generator), which is also used
Fix tests to not report unnecessary mismatch for 'directive' due to acorn v5.4.x
Note that the project is now structured so that:
- nodent-transform is the base level AST transfomer
- nodent-compiler is the transformer with a parser (acorn) and code generator (derived from astring)
- nodent is the compiler, require hook for node, CLI and helpers (like http, events, etc)
Roll-up fixes
Set default Promise implementation for http
covers from options.
Roll-up fixes in nodent-compiler (labelled break, onParserInstallation)
Roll-up fixes in nodent-runtime (avoid bugs with non-hoisting environments, minimal impl for Promise-supporting environments)
Correct parentheses in right-associative `new (fn())()`
Correctly walk destructuring assignment initializers
Fixes an issue where default initial values for destructured declarations were not transpiled:
const {bar1 = async () => 1} = {};
...now transpiles to....
const {bar1 = () => (function ($return, $error) {
return $return(1);
}).$asyncbind(this, true)} = {};
Add 'host' value to compiler options
Permit the compiler options es6target
, noRuntime
, promises
and engine
to be defined with the value "host"
, in which case they are determined from the execution environment the code was compiled in (ie. the version of nodejs). This allows transpiled code to gracefully compile across node >0.10 using additional features of each platform as they are available. An addition named set of options, also called "host"
is defined to use these values, allowing the directive "use nodent-host"
to compile code for the current platform. The new value can also be used to set (or reset) names sets in the package.json. For example, to set "host" as the default values:
"nodent":{
"directive":{
"default":{
"es6target":"host",
"promises":"host",
"engine":"host",
"noRuntime":"host"
}
}
}
Extract compiler into separate module 'nodent-compiler'
Allows compilation to take place with no CLI ot runtime (which requires modifications to Function.prototype and global namespace). Addresses #93