hermes-parser
Advanced tools
Comparing version 0.4.0 to 0.4.1
@@ -18,2 +18,4 @@ /** | ||
var hermesParseResult_getError = HermesParserWASM.cwrap('hermesParseResult_getError', 'string', ['number']); | ||
var hermesParseResult_getErrorLine = HermesParserWASM.cwrap('hermesParseResult_getErrorLine', 'number', ['number']); | ||
var hermesParseResult_getErrorColumn = HermesParserWASM.cwrap('hermesParseResult_getErrorColumn', 'number', ['number']); | ||
var hermesParseResult_getProgramBuffer = HermesParserWASM.cwrap('hermesParseResult_getProgramBuffer', 'number', ['number']); | ||
@@ -48,3 +50,8 @@ var hermesParseResult_getPositionBuffer = HermesParserWASM.cwrap('hermesParseResult_getPositionBuffer', 'number', ['number']); | ||
if (err) { | ||
throw new SyntaxError(err); | ||
var syntaxError = new SyntaxError(err); | ||
syntaxError.loc = { | ||
line: hermesParseResult_getErrorLine(parseResult), | ||
column: hermesParseResult_getErrorColumn(parseResult) | ||
}; | ||
throw syntaxError; | ||
} | ||
@@ -51,0 +58,0 @@ |
@@ -1049,2 +1049,3 @@ /** | ||
params: this.deserializeNodeList(), | ||
"this": this.deserializeNode(), | ||
returnType: this.deserializeNode(), | ||
@@ -1051,0 +1052,0 @@ rest: this.deserializeNode(), |
@@ -367,2 +367,3 @@ /** | ||
params: NODE_LIST_CHILD, | ||
"this": NODE_CHILD, | ||
returnType: NODE_CHILD, | ||
@@ -369,0 +370,0 @@ rest: NODE_CHILD, |
@@ -128,2 +128,6 @@ /** | ||
case 'FunctionDeclaration': | ||
case 'FunctionExpression': | ||
return this.mapFunction(node); | ||
default: | ||
@@ -396,2 +400,13 @@ return this.mapNodeDefault(node); | ||
} | ||
}, { | ||
key: "mapFunction", | ||
value: function mapFunction(node) { | ||
// Remove the first parameter if it is a this-type annotation, | ||
// which is not recognized by Babel. | ||
if (node.params.length !== 0 && node.params[0].name === 'this') { | ||
node.params.shift(); | ||
} | ||
return this.mapNodeDefault(node); | ||
} | ||
}]); | ||
@@ -398,0 +413,0 @@ |
{ | ||
"name": "hermes-parser", | ||
"version": "0.4.0", | ||
"version": "0.4.1", | ||
"description": "A JavaScript parser built from the Hermes engine", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
Sorry, the diff of this file is too big to display
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
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
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
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
1023854
3012