hermes-parser 0.28.1 → 0.29.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/HermesASTAdapter.js +1 -2
- package/dist/HermesASTAdapter.js.flow +2 -5
- package/dist/HermesParserNodeDeserializers.js +3 -2
- package/dist/HermesParserWASM.js +1 -1
- package/dist/HermesToESTreeAdapter.js +12 -0
- package/dist/HermesToESTreeAdapter.js.flow +10 -0
- package/dist/babel/TransformESTreeToBabel.js.flow +21 -19
- package/dist/estree/StripComponentSyntax.js.flow +6 -5
- package/dist/estree/TransformMatchSyntax.js +4 -15
- package/dist/estree/TransformMatchSyntax.js.flow +18 -19
- package/dist/generated/ESTreeVisitorKeys.js +1 -1
- package/dist/generated/ParserVisitorKeys.js +1 -1
- package/dist/index.js.flow +1 -1
- package/dist/src/HermesASTAdapter.js +192 -0
- package/dist/src/HermesParser.js +108 -0
- package/dist/src/HermesParserDecodeUTF8String.js +68 -0
- package/dist/src/HermesParserDeserializer.js +243 -0
- package/dist/src/HermesParserNodeDeserializers.js +2473 -0
- package/dist/src/HermesToESTreeAdapter.js +453 -0
- package/dist/src/ParserOptions.js +18 -0
- package/dist/src/babel/TransformESTreeToBabel.js +1104 -0
- package/dist/src/estree/StripComponentSyntax.js +788 -0
- package/dist/src/estree/StripFlowTypes.js +175 -0
- package/dist/src/estree/StripFlowTypesForBabel.js +215 -0
- package/dist/src/estree/TransformMatchSyntax.js +1005 -0
- package/dist/src/generated/ESTreeVisitorKeys.js +220 -0
- package/dist/src/generated/ParserVisitorKeys.js +790 -0
- package/dist/src/getModuleDocblock.js +112 -0
- package/dist/src/index.js +153 -0
- package/dist/src/transform/SimpleTransform.js +120 -0
- package/dist/src/transform/astArrayMutationHelpers.js +62 -0
- package/dist/src/transform/astNodeMutationHelpers.js +195 -0
- package/dist/src/traverse/SimpleTraverser.js +137 -0
- package/dist/src/traverse/getVisitorKeys.js +37 -0
- package/dist/src/utils/Builders.js +191 -0
- package/dist/src/utils/GenID.js +41 -0
- package/dist/src/utils/createSyntaxError.js +25 -0
- package/dist/src/utils/mutateESTreeASTForPrettier.js +127 -0
- package/dist/utils/Builders.js +17 -0
- package/dist/utils/Builders.js.flow +20 -0
- package/package.json +2 -2
package/dist/HermesASTAdapter.js
CHANGED
|
@@ -176,11 +176,10 @@ class HermesASTAdapter {
|
|
|
176
176
|
}
|
|
177
177
|
|
|
178
178
|
getBigIntLiteralValue(bigintString) {
|
|
179
|
-
// TODO - once we update flow we can remove this
|
|
180
179
|
const bigint = bigintString // estree spec is to not have a trailing `n` on this property
|
|
181
180
|
// https://github.com/estree/estree/blob/db962bb417a97effcfe9892f87fbb93c81a68584/es2020.md#bigintliteral
|
|
182
181
|
.replace(/n$/, '') // `BigInt` doesn't accept numeric separator and `bigint` property should not include numeric separator
|
|
183
|
-
.
|
|
182
|
+
.replaceAll('_', '');
|
|
184
183
|
return {
|
|
185
184
|
bigint,
|
|
186
185
|
// coerce the string to a bigint value if supported by the environment
|
|
@@ -172,17 +172,14 @@ export default class HermesASTAdapter {
|
|
|
172
172
|
|
|
173
173
|
getBigIntLiteralValue(bigintString: string): {
|
|
174
174
|
bigint: string,
|
|
175
|
-
value:
|
|
175
|
+
value: bigint | null,
|
|
176
176
|
} {
|
|
177
|
-
// TODO - once we update flow we can remove this
|
|
178
|
-
declare var BigInt: ?(value: $FlowFixMe) => mixed;
|
|
179
|
-
|
|
180
177
|
const bigint = bigintString
|
|
181
178
|
// estree spec is to not have a trailing `n` on this property
|
|
182
179
|
// https://github.com/estree/estree/blob/db962bb417a97effcfe9892f87fbb93c81a68584/es2020.md#bigintliteral
|
|
183
180
|
.replace(/n$/, '')
|
|
184
181
|
// `BigInt` doesn't accept numeric separator and `bigint` property should not include numeric separator
|
|
185
|
-
.
|
|
182
|
+
.replaceAll('_', '');
|
|
186
183
|
return {
|
|
187
184
|
bigint,
|
|
188
185
|
// coerce the string to a bigint value if supported by the environment
|
|
@@ -209,7 +209,8 @@ function deserializeBlockStatement() {
|
|
|
209
209
|
return {
|
|
210
210
|
type: 'BlockStatement',
|
|
211
211
|
loc: this.addEmptyLoc(),
|
|
212
|
-
body: this.deserializeNodeList()
|
|
212
|
+
body: this.deserializeNodeList(),
|
|
213
|
+
implicit: this.deserializeBoolean()
|
|
213
214
|
};
|
|
214
215
|
}
|
|
215
216
|
|
|
@@ -440,7 +441,7 @@ function deserializeImportExpression() {
|
|
|
440
441
|
type: 'ImportExpression',
|
|
441
442
|
loc: this.addEmptyLoc(),
|
|
442
443
|
source: this.deserializeNode(),
|
|
443
|
-
|
|
444
|
+
options: this.deserializeNode()
|
|
444
445
|
};
|
|
445
446
|
}
|
|
446
447
|
|