ast-types
Advanced tools
Comparing version 0.8.17 to 0.8.18
@@ -67,2 +67,6 @@ require("./es7"); | ||
def("NullTypeAnnotation") | ||
.bases("Type") | ||
.build(); | ||
def("ThisTypeAnnotation") | ||
@@ -168,3 +172,3 @@ .bases("Type") | ||
.build("params") | ||
.field("params", [def("Identifier")]); | ||
.field("params", [def("TypeParameter")]); | ||
@@ -176,2 +180,13 @@ def("TypeParameterInstantiation") | ||
def("TypeParameter") | ||
.bases("Type") | ||
.build("name", "variance", "bound") | ||
.field("name", String) | ||
.field("variance", | ||
or("plus", "minus", null), | ||
defaults["null"]) | ||
.field("bound", | ||
or(def("TypeAnnotation"), null), | ||
defaults["null"]); | ||
def("Function") | ||
@@ -178,0 +193,0 @@ .field("returnType", |
@@ -201,3 +201,3 @@ var types = require("./types"); | ||
var childPath = path.get(name); | ||
if (childPath.value !== child) { | ||
if (! pathHasValue(childPath, child)) { | ||
throw new Error(""); | ||
@@ -210,2 +210,19 @@ } | ||
function pathHasValue(path, value) { | ||
if (path.value === value) { | ||
return true; | ||
} | ||
// Empty arrays are probably produced by defaults.emptyArray, in which | ||
// case is makes sense to regard them as equivalent, if not ===. | ||
if (Array.isArray(path.value) && | ||
path.value.length === 0 && | ||
Array.isArray(value) && | ||
value.length === 0) { | ||
return true; | ||
} | ||
return false; | ||
} | ||
function recursiveScanChild(path, bindings, scopeTypes) { | ||
@@ -212,0 +229,0 @@ var node = path.value; |
@@ -21,3 +21,3 @@ { | ||
], | ||
"version": "0.8.17", | ||
"version": "0.8.18", | ||
"homepage": "http://github.com/benjamn/ast-types", | ||
@@ -24,0 +24,0 @@ "repository": { |
Sorry, the diff of this file is not supported yet
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
135418
3339