Comparing version 3.0.6 to 3.0.7
@@ -328,3 +328,3 @@ "use strict"; | ||
this.lastStatements = t.getLastStatements(ast.program); | ||
this.scope = new Scope(ast.program, null, this); | ||
this.scope = new Scope(ast.program, ast, null, this); | ||
this.moduleFormatter = this.getModuleFormatter(this.opts.modules); | ||
@@ -331,0 +331,0 @@ |
@@ -114,3 +114,3 @@ "use strict"; | ||
if (t.isScope(node)) { | ||
ourScope = new Scope(node, scope); | ||
ourScope = new Scope(node, parent, scope); | ||
} | ||
@@ -117,0 +117,0 @@ |
@@ -17,2 +17,3 @@ "use strict"; | ||
* @param {Node} block | ||
* @param {Node} parentBlock | ||
* @param {Scope} [parent] | ||
@@ -22,7 +23,9 @@ * @param {File} [file] | ||
function Scope(block, parent, file) { | ||
function Scope(block, parentBlock, parent, file) { | ||
this.parent = parent; | ||
this.block = block; | ||
this.file = parent ? parent.file : file; | ||
this.parentBlock = parentBlock; | ||
this.block = block; | ||
var info = this.getInfo(); | ||
@@ -202,2 +205,3 @@ this.references = info.references; | ||
if (parent && t.isBlockStatement(block) && t.isFor(parent.block, { body: block })) { | ||
// delegate block let declarations to the parent loop | ||
return info; | ||
@@ -246,2 +250,10 @@ } | ||
if (t.isFunctionExpression(block) && block.id) { | ||
if (!t.isProperty(this.parentBlock, { method: true })) { | ||
// SpiderMonkey AST doesn't use MethodDefinition here when it probably | ||
// should since they should be semantically the same? | ||
add(block.id); | ||
} | ||
} | ||
// Program | ||
@@ -248,0 +260,0 @@ |
@@ -5,2 +5,3 @@ "use strict"; | ||
var esutils = require("esutils"); | ||
var object = require("../helpers/object"); | ||
var Node = require("./node"); | ||
@@ -459,3 +460,3 @@ var _ = require("lodash"); | ||
var search = [].concat(node); | ||
var ids = {}; | ||
var ids = object(); | ||
@@ -462,0 +463,0 @@ while (search.length) { |
{ | ||
"name": "6to5-core", | ||
"description": "Turn ES6 code into readable vanilla ES5 with source maps", | ||
"version": "3.0.6", | ||
"version": "3.0.7", | ||
"author": "Sebastian McKenzie <sebmck@gmail.com>", | ||
@@ -30,4 +30,4 @@ "homepage": "https://6to5.org/", | ||
"commander": "2.6.0", | ||
"core-js": "0.4.6", | ||
"detect-indent": "^3.0.0", | ||
"core-js": "^0.4.9", | ||
"detect-indent": "3.0.0", | ||
"estraverse": "1.9.1", | ||
@@ -37,5 +37,5 @@ "esutils": "1.1.6", | ||
"fs-readdir-recursive": "0.1.0", | ||
"js-tokenizer": "^1.3.3", | ||
"js-tokenizer": "1.3.3", | ||
"lodash": "3.0.0", | ||
"output-file-sync": "^1.1.0", | ||
"output-file-sync": "1.1.0", | ||
"private": "0.1.6", | ||
@@ -47,4 +47,4 @@ "regenerator-6to5": "0.8.9-6", | ||
"source-map-support": "0.2.9", | ||
"supports-color": "^1.2.0" | ||
"supports-color": "1.2.0" | ||
} | ||
} |
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1356212
11356
+ Addedcore-js@0.4.10(transitive)
+ Addeddetect-indent@3.0.0(transitive)
+ Addedget-stdin@3.0.2(transitive)
+ Addedoutput-file-sync@1.1.0(transitive)
+ Addedsupports-color@1.2.0(transitive)
+ Addedxtend@4.0.2(transitive)
- Removedcore-js@0.4.6(transitive)
- Removeddetect-indent@3.0.1(transitive)
- Removedget-stdin@4.0.1(transitive)
- Removedobject-assign@4.1.1(transitive)
- Removedoutput-file-sync@1.1.2(transitive)
- Removedsupports-color@1.3.1(transitive)
Updatedcore-js@^0.4.9
Updateddetect-indent@3.0.0
Updatedjs-tokenizer@1.3.3
Updatedoutput-file-sync@1.1.0
Updatedsupports-color@1.2.0