Skip to content

Commit ab96bdd

Browse files
committed
Upgrade to Acorn 5.0.0
1 parent 2e87cab commit ab96bdd

2 files changed

Lines changed: 9 additions & 5 deletions

File tree

‎lib/Parser.js‎

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -536,8 +536,10 @@ Parser.prototype.walkForOfStatement = function walkForOfStatement(statement) {
536536

537537
// Declarations
538538
Parser.prototype.walkFunctionDeclaration = function walkFunctionDeclaration(statement) {
539-
this.scope.renames["$" + statement.id.name] = undefined;
540-
this.scope.definitions.push(statement.id.name);
539+
if(statement.id) {
540+
this.scope.renames["$" + statement.id.name] = undefined;
541+
this.scope.definitions.push(statement.id.name);
542+
}
541543
this.inScope(statement.params, function() {
542544
if(statement.body.type === "BlockStatement")
543545
this.walkStatement(statement.body);
@@ -637,8 +639,10 @@ Parser.prototype.walkVariableDeclaration = function walkVariableDeclaration(stat
637639
};
638640

639641
Parser.prototype.walkClassDeclaration = function walkClassDeclaration(statement) {
640-
this.scope.renames["$" + statement.id.name] = undefined;
641-
this.scope.definitions.push(statement.id.name);
642+
if(statement.id) {
643+
this.scope.renames["$" + statement.id.name] = undefined;
644+
this.scope.definitions.push(statement.id.name);
645+
}
642646
this.walkClass(statement);
643647
};
644648

‎package.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"author": "Tobias Koppers @sokra",
55
"description": "Packs CommonJs/AMD modules for the browser. Allows to split your codebase into multiple bundles, which can be loaded on demand. Support loaders to preprocess files, i.e. json, jsx, es7, css, less, ... and your custom stuff.",
66
"dependencies": {
7-
"acorn": "^4.0.4",
7+
"acorn": "^5.0.0",
88
"acorn-dynamic-import": "^2.0.0",
99
"ajv": "^4.7.0",
1010
"ajv-keywords": "^1.1.1",

0 commit comments

Comments
 (0)