Comparing version 1.0.0 to 1.0.1
@@ -14,3 +14,5 @@ 'use strict'; | ||
this.type = 'CallExpression'; | ||
this.arguments = new ArrayExpression({elements: this.nodes[0].arguments}); | ||
var args = this.nodes[0] ? this.nodes[0].arguments : []; | ||
this.arguments = new ArrayExpression({ elements: args }); | ||
}, | ||
@@ -17,0 +19,0 @@ |
{ | ||
"name": "ast-query", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"description": "Declarative JavaScript AST modification façade", | ||
@@ -5,0 +5,0 @@ "main": "lib/tree.js", |
@@ -13,2 +13,3 @@ /*globals describe, it, beforeEach */ | ||
this.tree3 = program('bar.doe.foo();'); | ||
this.tree4 = program('var a;'); | ||
}); | ||
@@ -25,2 +26,6 @@ | ||
it('can match no node', function () { | ||
assert.equal(this.tree4.callExpression('bar').length, 0); | ||
}); | ||
describe('#arguments', function () { | ||
@@ -27,0 +32,0 @@ describe('#push()', function () { |
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
37198
847