hermes-parser 0.36.0 → 0.37.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.
Files changed (79) hide show
  1. package/dist/HermesAST.js.flow +2 -2
  2. package/dist/HermesASTAdapter.js +1 -1
  3. package/dist/HermesParser.js +1 -1
  4. package/dist/HermesParserDecodeUTF8String.js +1 -1
  5. package/dist/HermesParserDeserializer.js +1 -1
  6. package/dist/HermesParserDeserializer.js.flow +8 -8
  7. package/dist/HermesParserNodeDeserializers.js +1 -1
  8. package/dist/HermesParserNodeDeserializers.js.flow +1 -1
  9. package/dist/HermesParserWASM.js +1 -1
  10. package/dist/HermesParserWASM.js.flow +6 -6
  11. package/dist/HermesToESTreeAdapter.js +3 -2
  12. package/dist/HermesToESTreeAdapter.js.flow +4 -3
  13. package/dist/ParserOptions.js +5 -3
  14. package/dist/ParserOptions.js.flow +5 -5
  15. package/dist/babel/TransformESTreeToBabel.js +4 -3
  16. package/dist/babel/TransformESTreeToBabel.js.flow +101 -100
  17. package/dist/estree/StripFlowTypes.js +1 -1
  18. package/dist/estree/StripFlowTypesForBabel.js +1 -1
  19. package/dist/estree/TransformComponentSyntax.js +1 -1
  20. package/dist/estree/TransformComponentSyntax.js.flow +3 -3
  21. package/dist/estree/TransformEnumSyntax.js +1 -1
  22. package/dist/estree/TransformEnumSyntax.js.flow +1 -1
  23. package/dist/estree/TransformMatchSyntax.js +11 -2
  24. package/dist/estree/TransformMatchSyntax.js.flow +10 -9
  25. package/dist/estree/TransformRecordSyntax.js +1 -1
  26. package/dist/generated/ESTreeVisitorKeys.js +1 -1
  27. package/dist/generated/ESTreeVisitorKeys.js.flow +1 -1
  28. package/dist/generated/ParserVisitorKeys.js +1 -1
  29. package/dist/generated/ParserVisitorKeys.js.flow +2 -2
  30. package/dist/getModuleDocblock.js +1 -1
  31. package/dist/index.js +4 -3
  32. package/dist/index.js.flow +5 -5
  33. package/dist/src/HermesASTAdapter.js +1 -1
  34. package/dist/src/HermesParser.js +1 -1
  35. package/dist/src/HermesParserDecodeUTF8String.js +1 -1
  36. package/dist/src/HermesParserDeserializer.js +1 -1
  37. package/dist/src/HermesParserNodeDeserializers.js +1 -1
  38. package/dist/src/HermesToESTreeAdapter.js +3 -2
  39. package/dist/src/ParserOptions.js +5 -3
  40. package/dist/src/babel/TransformESTreeToBabel.js +4 -3
  41. package/dist/src/estree/StripFlowTypes.js +1 -1
  42. package/dist/src/estree/StripFlowTypesForBabel.js +1 -1
  43. package/dist/src/estree/TransformComponentSyntax.js +1 -1
  44. package/dist/src/estree/TransformEnumSyntax.js +1 -1
  45. package/dist/src/estree/TransformMatchSyntax.js +11 -2
  46. package/dist/src/estree/TransformRecordSyntax.js +1 -1
  47. package/dist/src/generated/ESTreeVisitorKeys.js +1 -1
  48. package/dist/src/generated/ParserVisitorKeys.js +1 -1
  49. package/dist/src/getModuleDocblock.js +1 -1
  50. package/dist/src/index.js +4 -3
  51. package/dist/src/transform/SimpleTransform.js +10 -1
  52. package/dist/src/transform/astArrayMutationHelpers.js +1 -1
  53. package/dist/src/transform/astNodeMutationHelpers.js +4 -3
  54. package/dist/src/traverse/SimpleTraverser.js +4 -2
  55. package/dist/src/traverse/getVisitorKeys.js +5 -3
  56. package/dist/src/utils/Builders.js +2 -3
  57. package/dist/src/utils/GenID.js +1 -1
  58. package/dist/src/utils/createSyntaxError.js +1 -1
  59. package/dist/src/utils/isReservedWord.js +1 -1
  60. package/dist/src/utils/mutateESTreeASTForPrettier.js +1 -1
  61. package/dist/transform/SimpleTransform.js +10 -1
  62. package/dist/transform/SimpleTransform.js.flow +6 -7
  63. package/dist/transform/astArrayMutationHelpers.js +1 -1
  64. package/dist/transform/astArrayMutationHelpers.js.flow +8 -8
  65. package/dist/transform/astNodeMutationHelpers.js +4 -3
  66. package/dist/transform/astNodeMutationHelpers.js.flow +12 -6
  67. package/dist/traverse/SimpleTraverser.js +4 -2
  68. package/dist/traverse/SimpleTraverser.js.flow +4 -4
  69. package/dist/traverse/getVisitorKeys.js +5 -3
  70. package/dist/traverse/getVisitorKeys.js.flow +5 -3
  71. package/dist/utils/Builders.js +2 -3
  72. package/dist/utils/Builders.js.flow +6 -6
  73. package/dist/utils/GenID.js +1 -1
  74. package/dist/utils/GenID.js.flow +2 -2
  75. package/dist/utils/createSyntaxError.js +1 -1
  76. package/dist/utils/isReservedWord.js +1 -1
  77. package/dist/utils/mutateESTreeASTForPrettier.js +1 -1
  78. package/dist/utils/mutateESTreeASTForPrettier.js.flow +1 -1
  79. package/package.json +4 -3
@@ -12,9 +12,9 @@
12
12
 
13
13
  export type HermesPosition = {
14
14
  /** >= 1 */
15
- +line: number,
15
+ readonly line: number,
16
16
  /** >= 0 */
17
- +column: number,
17
+ readonly column: number,
18
18
  };
19
19
  export type HermesSourceLocation = {
20
20
  start?: HermesPosition,
@@ -13,7 +13,7 @@ var _ParserVisitorKeys = require("./generated/ParserVisitorKeys");
13
13
  * This source code is licensed under the MIT license found in the
14
14
  * LICENSE file in the root directory of this source tree.
15
15
  *
16
- *
16
+ * strict
17
17
  * @format
18
18
  */
19
19
 
@@ -4,7 +4,7 @@
4
4
  * This source code is licensed under the MIT license found in the
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  *
7
- *
7
+ * strict
8
8
  * @format
9
9
  */
10
10
  'use strict';
@@ -4,7 +4,7 @@
4
4
  * This source code is licensed under the MIT license found in the
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  *
7
- *
7
+ * strict
8
8
  * @format
9
9
  */
10
10
  'use strict';
@@ -4,7 +4,7 @@
4
4
  * This source code is licensed under the MIT license found in the
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  *
7
- *
7
+ * strict
8
8
  * @format
9
9
  */
10
10
  'use strict';
@@ -25,22 +25,22 @@ import NODE_DESERIALIZERS from './HermesParserNodeDeserializers';
25
25
  export default class HermesParserDeserializer {
26
26
  programBufferIdx: number;
27
27
  positionBufferIdx: number;
28
- +positionBufferSize: number;
29
- +locMap: {[number]: HermesSourceLocation};
30
- +HEAPU8: HermesParserWASM['HEAPU8'];
31
- +HEAPU32: HermesParserWASM['HEAPU32'];
32
- +HEAPF64: HermesParserWASM['HEAPF64'];
33
- +options: ParserOptions;
28
+ readonly positionBufferSize: number;
29
+ readonly locMap: {[number]: HermesSourceLocation};
30
+ readonly HEAPU8: HermesParserWASM['HEAPU8'];
31
+ readonly HEAPU32: HermesParserWASM['HEAPU32'];
32
+ readonly HEAPF64: HermesParserWASM['HEAPF64'];
33
+ readonly options: ParserOptions;
34
34
 
35
35
  // Matches StoredComment::Kind enum in JSLexer.h
36
- +commentTypes: $ReadOnlyArray<HermesComment['type']> = [
36
+ readonly commentTypes: ReadonlyArray<HermesComment['type']> = [
37
37
  'CommentLine',
38
38
  'CommentBlock',
39
39
  'InterpreterDirective',
40
40
  ];
41
41
 
42
42
  // Matches TokenType enum in HermesParserJSSerializer.h
43
- +tokenTypes: $ReadOnlyArray<HermesToken['type']> = [
43
+ readonly tokenTypes: ReadonlyArray<HermesToken['type']> = [
44
44
  'Boolean',
45
45
  'Identifier',
46
46
  'Keyword',
@@ -18,7 +18,7 @@
18
18
 
19
19
  /* eslint no-undef: 'error', no-unused-vars: ['error', {vars: "local"}], no-redeclare: 'error' */
20
20
 
21
- /* global $NonMaybeType, Partial, $ReadOnly, $ReadOnlyArray, $FlowFixMe */
21
+ /* global NonNullable, Partial, Readonly, ReadonlyArray, $FlowFixMe */
22
22
  'use strict';
23
23
 
24
24
  function deserializeEmpty() {
@@ -11,6 +11,6 @@
11
11
  import type {HermesNode} from './HermesAST';
12
12
  import type HermesParserDeserializer from './HermesParserDeserializer';
13
13
 
14
- declare module.exports: $ReadOnlyArray<
14
+ declare module.exports: ReadonlyArray<
15
15
  (this: HermesParserDeserializer) => HermesNode,
16
16
  >;