ast-types
Advanced tools
Comparing version 0.3.28 to 0.3.29
@@ -171,3 +171,3 @@ var types = require("../lib/types"); | ||
.bases("Function", "Declaration") | ||
.build("id", "params", "body", "generator", "expression", "async") | ||
.build("id", "params", "body", "generator", "expression") | ||
.field("id", def("Identifier")); | ||
@@ -177,3 +177,3 @@ | ||
.bases("Function", "Expression") | ||
.build("id", "params", "body", "generator", "expression", "async"); | ||
.build("id", "params", "body", "generator", "expression"); | ||
@@ -180,0 +180,0 @@ def("VariableDeclaration") |
@@ -5,2 +5,3 @@ var assert = require("assert"); | ||
var namedTypes = types.namedTypes; | ||
var builders = types.builders; | ||
var Node = namedTypes.Node; | ||
@@ -64,2 +65,16 @@ var isArray = types.builtInTypes.array; | ||
Sp.declareTemporary = function(prefix) { | ||
assert.ok(/^[a-z$_]/i.test(prefix), prefix); | ||
this.scan(); | ||
var index = 0; | ||
while (this.declares(prefix + index)) { | ||
++index; | ||
} | ||
var id = builders.identifier(prefix + index); | ||
this.bindings[prefix + index] = id; | ||
return id; | ||
}; | ||
Sp.scan = function(force) { | ||
@@ -66,0 +81,0 @@ if (force || !this.didScan) { |
@@ -21,3 +21,3 @@ { | ||
], | ||
"version": "0.3.28", | ||
"version": "0.3.29", | ||
"homepage": "http://github.com/benjamn/ast-types", | ||
@@ -24,0 +24,0 @@ "repository": { |
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
433639
12065