Skip to content

Commit 8933c13

Browse files
author
Andrew Schmadel
committed
fix crash on illegal component declaration
closes #11
1 parent 277718a commit 8933c13

2 files changed

Lines changed: 5 additions & 2 deletions

File tree

CHANGES.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
# babel-plugin-angularjs-annotate changelog
22

3+
## v0.5.2 2016-09-28
4+
* bugfix: fix crash on illegal component declaration (#11)
5+
36
## v0.5.0 2016-08-04
47
* bugfix: follow references in component definition objects (#7)
58
* bugfix: remove superfluous dependency on `babel`

ng-annotate-main.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -389,7 +389,7 @@ function matchRegular(path, ctx) {
389389
args.length === 1 && argPaths[0] :
390390
args.length === 2 && t.isLiteral(args[0]) && is.string(args[0].value) && argPaths[1]);
391391

392-
if (method.name === "component") {
392+
if (method.name === "component" && target) {
393393
target.node.$chained = chainedRegular;
394394
return matchComponent(target);
395395
}
@@ -656,7 +656,7 @@ function followReference(path) {
656656
const bound = binding.path;
657657

658658
if (is.someof(kind, ["const", "let", "var"])) {
659-
659+
660660
if(t.isVariableDeclaration(bound)){
661661
var declarations = bound.get('declarations');
662662
assert(declarations.length === 1);

0 commit comments

Comments
 (0)