Comparing version 0.4.0 to 0.4.1
@@ -88,13 +88,3 @@ "use strict"; | ||
// There's no block-scope under it | ||
// Function name goes in parent scope | ||
if (node.id) { | ||
// if (node.type === "FunctionExpression") { | ||
// console.dir(node.id); | ||
// } | ||
// assert(node.type === "FunctionDeclaration"); // no support for named function expressions yet | ||
assert(node.id.type === "Identifier"); | ||
node.$parent.$scope.add(node.id.name, "fun", node.id, null); | ||
} | ||
node.$scope = new Scope({ | ||
@@ -106,2 +96,17 @@ kind: "hoist", | ||
// function has a name | ||
if (node.id) { | ||
assert(node.id.type === "Identifier"); | ||
if (node.type === "FunctionDeclaration") { | ||
// Function name goes in parent scope for declared functions | ||
node.$parent.$scope.add(node.id.name, "fun", node.id, null); | ||
} else if (node.type === "FunctionExpression") { | ||
// Function name goes in function's scope for named function expressions | ||
node.$scope.add(node.id.name, "fun", node.id, null); | ||
} else { | ||
assert(false); | ||
} | ||
} | ||
node.params.forEach(function(param) { | ||
@@ -108,0 +113,0 @@ node.$scope.add(param.name, "param", param, null); |
@@ -0,8 +1,11 @@ | ||
## v0.4.1 2013-07-28 | ||
* Bugfix named function expressions (issue #12) | ||
## v0.4 2013-07-10 | ||
* defs became self aware | ||
* NPM package includes (and defaults to) the self-transpiled version | ||
* Bugfix renaming of index-expressions such as arr[i] (issue #10) | ||
* Bugfix renaming of index-expressions such as `arr[i]` (issue #10) | ||
## v0.3 2013-07-05 | ||
* defs used as a library returns errors collected to ret.errors instead | ||
of writing to stderr. This also deprecates ret.exitcode. | ||
* defs used as a library returns errors collected to `ret.errors` instead | ||
of writing to stderr. This also deprecates `ret.exitcode` |
@@ -88,13 +88,3 @@ "use strict"; | ||
// There's no block-scope under it | ||
// Function name goes in parent scope | ||
if (node.id) { | ||
// if (node.type === "FunctionExpression") { | ||
// console.dir(node.id); | ||
// } | ||
// assert(node.type === "FunctionDeclaration"); // no support for named function expressions yet | ||
assert(node.id.type === "Identifier"); | ||
node.$parent.$scope.add(node.id.name, "fun", node.id, null); | ||
} | ||
node.$scope = new Scope({ | ||
@@ -106,2 +96,17 @@ kind: "hoist", | ||
// function has a name | ||
if (node.id) { | ||
assert(node.id.type === "Identifier"); | ||
if (node.type === "FunctionDeclaration") { | ||
// Function name goes in parent scope for declared functions | ||
node.$parent.$scope.add(node.id.name, "fun", node.id, null); | ||
} else if (node.type === "FunctionExpression") { | ||
// Function name goes in function's scope for named function expressions | ||
node.$scope.add(node.id.name, "fun", node.id, null); | ||
} else { | ||
assert(false); | ||
} | ||
} | ||
node.params.forEach(function(param) { | ||
@@ -108,0 +113,0 @@ node.$scope.add(param.name, "param", param, null); |
{ | ||
"name": "defs", | ||
"version": "0.4.0", | ||
"version": "0.4.1", | ||
"description": "Static scope analysis and transpilation of ES6 block scoped const and let variables, to ES3.", | ||
@@ -5,0 +5,0 @@ "main": "build/es5/defs-main.js", |
99366
79
2700