hermes-parser
Advanced tools
Comparing version 0.10.0 to 0.10.1
@@ -8,3 +8,3 @@ "use strict"; | ||
var _visitorKeys = require("./generated/visitor-keys"); | ||
var _ParserVisitorKeys = require("./generated/ParserVisitorKeys"); | ||
@@ -21,11 +21,2 @@ /** | ||
/* | ||
This class does some very "javascripty" things in the name of | ||
performance which are ultimately impossible to soundly type. | ||
So instead of adding strict types and a large number of suppression | ||
comments, instead it is left untyped and subclasses are strictly | ||
typed via a separate flow declaration file. | ||
*/ | ||
/** | ||
@@ -84,3 +75,3 @@ * The base class for transforming the Hermes AST to the desired output format. | ||
mapNodeDefault(node) { | ||
const visitorKeys = _visitorKeys.HERMES_AST_VISITOR_KEYS[node.type]; | ||
const visitorKeys = _ParserVisitorKeys.HERMES_AST_VISITOR_KEYS[node.type]; | ||
@@ -90,3 +81,3 @@ for (const key in visitorKeys) { | ||
if (childType === _visitorKeys.NODE_CHILD) { | ||
if (childType === _ParserVisitorKeys.NODE_CHILD) { | ||
const child = node[key]; | ||
@@ -97,3 +88,3 @@ | ||
} | ||
} else if (childType === _visitorKeys.NODE_LIST_CHILD) { | ||
} else if (childType === _ParserVisitorKeys.NODE_LIST_CHILD) { | ||
const children = node[key]; | ||
@@ -100,0 +91,0 @@ |
@@ -21,3 +21,3 @@ /** | ||
/* global $NonMaybeType, $Partial, $ReadOnly, $ReadOnlyArray */ | ||
/* global $NonMaybeType, Partial, $ReadOnly, $ReadOnlyArray */ | ||
'use strict'; | ||
@@ -24,0 +24,0 @@ |
@@ -21,11 +21,2 @@ "use strict"; | ||
*/ | ||
/* | ||
This class does some very "javascripty" things in the name of | ||
performance which are ultimately impossible to soundly type. | ||
So instead of adding strict types and a large number of suppression | ||
comments, instead it is left untyped and subclasses are strictly | ||
typed via a separate flow declaration file. | ||
*/ | ||
class HermesToBabelAdapter extends _HermesASTAdapter.default { | ||
@@ -32,0 +23,0 @@ fixSourceLocation(node) { |
@@ -23,11 +23,2 @@ "use strict"; | ||
*/ | ||
/* | ||
This class does some very "javascripty" things in the name of | ||
performance which are ultimately impossible to soundly type. | ||
So instead of adding strict types and a large number of suppression | ||
comments, instead it is left untyped and subclasses are strictly | ||
typed via a separate flow declaration file. | ||
*/ | ||
class HermesToESTreeAdapter extends _HermesASTAdapter.default { | ||
@@ -135,6 +126,6 @@ constructor(options, code) { | ||
mapProgram(node) { | ||
node = this.mapNodeDefault(node); | ||
const nodeDefault = this.mapNodeDefault(node); | ||
node.sourceType = this.getSourceType(); | ||
node.docblock = (0, _getModuleDocblock.getModuleDocblock)(node); | ||
return node; | ||
node.docblock = (0, _getModuleDocblock.getModuleDocblock)(nodeDefault); | ||
return nodeDefault; | ||
} | ||
@@ -141,0 +132,0 @@ |
@@ -17,2 +17,3 @@ /** | ||
parse: true, | ||
FlowVisitorKeys: true, | ||
astArrayMutationHelpers: true, | ||
@@ -30,2 +31,6 @@ astNodeMutationHelpers: true | ||
var _ESTreeVisitorKeys = _interopRequireDefault(require("./generated/ESTreeVisitorKeys")); | ||
exports.FlowVisitorKeys = _ESTreeVisitorKeys.default; | ||
var _SimpleTraverser = require("./traverse/SimpleTraverser"); | ||
@@ -32,0 +37,0 @@ |
@@ -18,4 +18,6 @@ /** | ||
var _hermesEslint = require("hermes-eslint"); | ||
var _ESTreeVisitorKeys = _interopRequireDefault(require("../generated/ESTreeVisitorKeys")); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
function isNode(thing) { | ||
@@ -26,3 +28,3 @@ return typeof thing === 'object' && thing != null && typeof thing.type === 'string'; | ||
function getVisitorKeys(node, visitorKeys) { | ||
const keys = (visitorKeys != null ? visitorKeys : _hermesEslint.VisitorKeys)[node.type]; | ||
const keys = (visitorKeys != null ? visitorKeys : _ESTreeVisitorKeys.default)[node.type]; | ||
@@ -29,0 +31,0 @@ if (keys == null) { |
{ | ||
"name": "hermes-parser", | ||
"version": "0.10.0", | ||
"version": "0.10.1", | ||
"description": "A JavaScript parser built from the Hermes engine", | ||
@@ -12,3 +12,3 @@ "main": "dist/index.js", | ||
"dependencies": { | ||
"hermes-estree": "0.10.0" | ||
"hermes-estree": "0.10.1" | ||
}, | ||
@@ -15,0 +15,0 @@ "devDependencies": { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
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
906271
4406
+ Addedhermes-estree@0.10.1(transitive)
- Removedhermes-estree@0.10.0(transitive)
Updatedhermes-estree@0.10.1