hermes-parser
Advanced tools
Comparing version 0.17.1 to 0.18.0
@@ -132,3 +132,3 @@ /** | ||
if (params.length === 1 && params[0].type === 'RestElement' && (params[0].argument.type === 'Identifier' || params[0].argument.type === 'ObjectPattern')) { | ||
if (params.length === 1 && params[0].type === 'RestElement' && params[0].argument.type === 'Identifier') { | ||
var _restElementArgument$, _restElementArgument$2; | ||
@@ -155,3 +155,3 @@ | ||
}); | ||
const propsProperties = paramsWithoutRef.map(mapComponentParameter); | ||
const propsProperties = paramsWithoutRef.flatMap(mapComponentParameter); | ||
let props = null; | ||
@@ -213,9 +213,28 @@ | ||
{ | ||
const a = nodeWith(param, { | ||
typeAnnotation: null, | ||
argument: nodeWith(param.argument, { | ||
typeAnnotation: null | ||
}) | ||
}); | ||
return a; | ||
switch (param.argument.type) { | ||
case 'Identifier': | ||
{ | ||
const a = nodeWith(param, { | ||
typeAnnotation: null, | ||
argument: nodeWith(param.argument, { | ||
typeAnnotation: null | ||
}) | ||
}); | ||
return [a]; | ||
} | ||
case 'ObjectPattern': | ||
{ | ||
return param.argument.properties.map(property => { | ||
return nodeWith(property, { | ||
typeAnnotation: null | ||
}); | ||
}); | ||
} | ||
default: | ||
{ | ||
throw (0, _createSyntaxError.createSyntaxError)(param, `Unhandled ${param.argument.type} encountered in restParameter`); | ||
} | ||
} | ||
} | ||
@@ -243,3 +262,3 @@ | ||
if (param.name.type === 'Identifier' && param.shorthand && (value.type === 'Identifier' || value.type === 'AssignmentPattern')) { | ||
return { | ||
return [{ | ||
type: 'Property', | ||
@@ -255,7 +274,7 @@ key: param.name, | ||
parent: EMPTY_PARENT | ||
}; | ||
}]; | ||
} // Complex params | ||
return { | ||
return [{ | ||
type: 'Property', | ||
@@ -271,3 +290,3 @@ key: param.name, | ||
parent: EMPTY_PARENT | ||
}; | ||
}]; | ||
} | ||
@@ -274,0 +293,0 @@ |
{ | ||
"name": "hermes-parser", | ||
"version": "0.17.1", | ||
"version": "0.18.0", | ||
"description": "A JavaScript parser built from the Hermes engine", | ||
@@ -12,3 +12,3 @@ "main": "dist/index.js", | ||
"dependencies": { | ||
"hermes-estree": "0.17.1" | ||
"hermes-estree": "0.18.0" | ||
}, | ||
@@ -15,0 +15,0 @@ "devDependencies": { |
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
1040655
6242
+ Addedhermes-estree@0.18.0(transitive)
- Removedhermes-estree@0.17.1(transitive)
Updatedhermes-estree@0.18.0