@idlizer/arktscgen 2.1.9-arktscgen-6 → 2.1.9-arktscgen-9

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 (322) hide show
  1. package/build/libarkts-copy/generator/options.json5 +165 -3
  2. package/build/libarkts-copy/native/meson.build +11 -12
  3. package/build/libarkts-copy/native/meson_options.txt +1 -1
  4. package/build/libarkts-copy/native/mingw.cross +14 -0
  5. package/build/libarkts-copy/native/src/bridges.cc +105 -15
  6. package/build/libarkts-copy/native/src/common.cc +11 -7
  7. package/build/libarkts-copy/native/src/common.h +1 -0
  8. package/build/libarkts-copy/native/src/generated/bridges.cc +318 -35
  9. package/build/libarkts-copy/package.json +24 -21
  10. package/build/libarkts-copy/src/Es2pandaNativeModule.ts +33 -6
  11. package/build/libarkts-copy/src/arkts-api/ChainExpressionFilter.ts +2 -1
  12. package/build/libarkts-copy/src/arkts-api/ImportStorage.ts +18 -12
  13. package/build/libarkts-copy/src/arkts-api/ProgramProvider.ts +1 -1
  14. package/build/libarkts-copy/src/arkts-api/factory/nodeFactory.ts +15 -26
  15. package/build/libarkts-copy/src/arkts-api/index.ts +2 -4
  16. package/build/libarkts-copy/src/arkts-api/node-utilities/BlockStatement.ts +0 -4
  17. package/build/libarkts-copy/src/arkts-api/node-utilities/CallExpression.ts +1 -22
  18. package/build/libarkts-copy/src/arkts-api/node-utilities/ClassDefinition.ts +7 -8
  19. package/build/libarkts-copy/src/arkts-api/node-utilities/ClassProperty.ts +1 -22
  20. package/build/libarkts-copy/src/arkts-api/node-utilities/ETSFunctionType.ts +2 -5
  21. package/build/libarkts-copy/src/arkts-api/node-utilities/ETSImportDeclaration.ts +1 -1
  22. package/build/libarkts-copy/src/arkts-api/node-utilities/ETSModule.ts +44 -0
  23. package/build/libarkts-copy/src/arkts-api/node-utilities/ETSParameterExpression.ts +1 -4
  24. package/build/libarkts-copy/src/arkts-api/node-utilities/MethodDefinition.ts +3 -12
  25. package/build/libarkts-copy/src/arkts-api/node-utilities/ObjectExpression.ts +1 -1
  26. package/build/libarkts-copy/src/arkts-api/node-utilities/Program.ts +10 -11
  27. package/build/libarkts-copy/src/arkts-api/node-utilities/ScriptFunction.ts +17 -6
  28. package/build/libarkts-copy/src/arkts-api/node-utilities/TSInterfaceDeclaration.ts +3 -6
  29. package/build/libarkts-copy/src/arkts-api/peers/AstNode.ts +3 -3
  30. package/build/libarkts-copy/src/arkts-api/peers/Config.ts +1 -1
  31. package/build/libarkts-copy/src/arkts-api/peers/Context.ts +26 -5
  32. package/build/libarkts-copy/src/arkts-api/peers/ExternalSource.ts +4 -0
  33. package/build/libarkts-copy/src/arkts-api/plugins.ts +15 -7
  34. package/build/libarkts-copy/src/arkts-api/static/global.ts +3 -2
  35. package/build/libarkts-copy/src/{wrapper-compat/arkts-api → arkts-api}/static/globalUtils.ts +4 -4
  36. package/build/libarkts-copy/src/arkts-api/static/profiler.ts +0 -8
  37. package/build/libarkts-copy/src/arkts-api/utilities/extensions.ts +80 -0
  38. package/build/libarkts-copy/src/arkts-api/utilities/nativePtrDecoder.ts +1 -1
  39. package/build/libarkts-copy/src/arkts-api/utilities/private.ts +5 -5
  40. package/build/libarkts-copy/src/arkts-api/utilities/public.ts +217 -29
  41. package/build/libarkts-copy/src/arkts-api/visitor.ts +17 -10
  42. package/build/libarkts-copy/src/checkSdk.ts +15 -0
  43. package/build/libarkts-copy/src/generated/Es2pandaEnums.ts +343 -321
  44. package/build/libarkts-copy/src/generated/Es2pandaNativeModule.ts +97 -14
  45. package/build/libarkts-copy/src/generated/factory.ts +40 -27
  46. package/build/libarkts-copy/src/generated/index.ts +4 -2
  47. package/build/libarkts-copy/src/generated/peers/AnnotatedAstNode.ts +2 -2
  48. package/build/libarkts-copy/src/generated/peers/AnnotatedExpression.ts +2 -2
  49. package/build/libarkts-copy/src/generated/peers/AnnotatedStatement.ts +2 -2
  50. package/build/libarkts-copy/src/generated/peers/AnnotationDeclaration.ts +11 -5
  51. package/build/libarkts-copy/src/generated/peers/AnnotationUsage.ts +11 -5
  52. package/build/libarkts-copy/src/generated/peers/ArkTsConfig.ts +2 -2
  53. package/build/libarkts-copy/src/generated/peers/ArrayExpression.ts +12 -6
  54. package/build/libarkts-copy/src/generated/peers/ArrowFunctionExpression.ts +26 -8
  55. package/build/libarkts-copy/src/generated/peers/AssertStatement.ts +8 -4
  56. package/build/libarkts-copy/src/generated/peers/AssignmentExpression.ts +12 -6
  57. package/build/libarkts-copy/src/generated/peers/AstDumper.ts +2 -2
  58. package/build/libarkts-copy/src/generated/peers/AstVerifier.ts +2 -2
  59. package/build/libarkts-copy/src/generated/peers/AstVisitor.ts +2 -2
  60. package/build/libarkts-copy/src/generated/peers/AwaitExpression.ts +8 -4
  61. package/build/libarkts-copy/src/generated/peers/BigIntLiteral.ts +8 -4
  62. package/build/libarkts-copy/src/generated/peers/BinaryExpression.ts +8 -4
  63. package/build/libarkts-copy/src/generated/peers/BindingProps.ts +2 -2
  64. package/build/libarkts-copy/src/generated/peers/BlockExpression.ts +9 -5
  65. package/build/libarkts-copy/src/generated/peers/BlockStatement.ts +8 -4
  66. package/build/libarkts-copy/src/generated/peers/BooleanLiteral.ts +8 -4
  67. package/build/libarkts-copy/src/generated/peers/BreakStatement.ts +11 -5
  68. package/build/libarkts-copy/src/generated/peers/CallExpression.ts +19 -7
  69. package/build/libarkts-copy/src/generated/peers/CatchClause.ts +11 -5
  70. package/build/libarkts-copy/src/generated/peers/ChainExpression.ts +8 -4
  71. package/build/libarkts-copy/src/generated/peers/CharLiteral.ts +8 -4
  72. package/build/libarkts-copy/src/generated/peers/ClassDeclaration.ts +21 -8
  73. package/build/libarkts-copy/src/generated/peers/ClassDefinition.ts +37 -13
  74. package/build/libarkts-copy/src/generated/peers/ClassElement.ts +2 -2
  75. package/build/libarkts-copy/src/generated/peers/ClassExpression.ts +8 -4
  76. package/build/libarkts-copy/src/generated/peers/ClassProperty.ts +19 -7
  77. package/build/libarkts-copy/src/generated/peers/ClassStaticBlock.ts +8 -4
  78. package/build/libarkts-copy/src/generated/peers/CodeGen.ts +2 -2
  79. package/build/libarkts-copy/src/generated/peers/ConditionalExpression.ts +8 -4
  80. package/build/libarkts-copy/src/generated/peers/ContinueStatement.ts +11 -5
  81. package/build/libarkts-copy/src/generated/peers/DebuggerStatement.ts +8 -4
  82. package/build/libarkts-copy/src/generated/peers/Declaration.ts +2 -2
  83. package/build/libarkts-copy/src/generated/peers/Decorator.ts +8 -4
  84. package/build/libarkts-copy/src/generated/peers/DiagnosticInfo.ts +2 -2
  85. package/build/libarkts-copy/src/generated/peers/DirectEvalExpression.ts +8 -4
  86. package/build/libarkts-copy/src/generated/peers/DoWhileStatement.ts +8 -4
  87. package/build/libarkts-copy/src/generated/peers/DynamicImportData.ts +2 -2
  88. package/build/libarkts-copy/src/generated/peers/ETSClassLiteral.ts +9 -5
  89. package/build/libarkts-copy/src/generated/peers/ETSFunctionType.ts +20 -13
  90. package/build/libarkts-copy/src/generated/peers/ETSImportDeclaration.ts +9 -5
  91. package/build/libarkts-copy/src/generated/peers/ETSIntrinsicNode.ts +77 -0
  92. package/build/libarkts-copy/src/generated/peers/ETSKeyofType.ts +9 -5
  93. package/build/libarkts-copy/src/generated/peers/ETSModule.ts +11 -5
  94. package/build/libarkts-copy/src/generated/peers/ETSNewArrayInstanceExpression.ts +9 -5
  95. package/build/libarkts-copy/src/generated/peers/ETSNewClassInstanceExpression.ts +12 -6
  96. package/build/libarkts-copy/src/generated/peers/ETSNewMultiDimArrayInstanceExpression.ts +12 -6
  97. package/build/libarkts-copy/src/generated/peers/ETSNullType.ts +9 -5
  98. package/build/libarkts-copy/src/generated/peers/ETSPackageDeclaration.ts +9 -5
  99. package/build/libarkts-copy/src/generated/peers/ETSParameterExpression.ts +46 -14
  100. package/build/libarkts-copy/src/generated/peers/ETSPrimitiveType.ts +9 -5
  101. package/build/libarkts-copy/src/generated/peers/ETSReExportDeclaration.ts +3 -3
  102. package/build/libarkts-copy/src/generated/peers/ETSStringLiteralType.ts +9 -5
  103. package/build/libarkts-copy/src/generated/peers/ETSStructDeclaration.ts +9 -5
  104. package/build/libarkts-copy/src/generated/peers/ETSTuple.ts +21 -9
  105. package/build/libarkts-copy/src/generated/peers/ETSTypeReference.ts +9 -5
  106. package/build/libarkts-copy/src/generated/peers/ETSTypeReferencePart.ts +12 -6
  107. package/build/libarkts-copy/src/generated/peers/ETSUndefinedType.ts +9 -5
  108. package/build/libarkts-copy/src/generated/peers/ETSUnionType.ts +20 -7
  109. package/build/libarkts-copy/src/generated/peers/ETSWildcardType.ts +9 -5
  110. package/build/libarkts-copy/src/generated/peers/EmptyStatement.ts +11 -5
  111. package/build/libarkts-copy/src/generated/peers/ErrorLogger.ts +2 -2
  112. package/build/libarkts-copy/src/generated/peers/ExportAllDeclaration.ts +8 -4
  113. package/build/libarkts-copy/src/generated/peers/ExportDefaultDeclaration.ts +8 -4
  114. package/build/libarkts-copy/src/generated/peers/ExportNamedDeclaration.ts +20 -8
  115. package/build/libarkts-copy/src/generated/peers/ExportSpecifier.ts +8 -4
  116. package/build/libarkts-copy/src/generated/peers/Expression.ts +2 -2
  117. package/build/libarkts-copy/src/generated/peers/ExpressionStatement.ts +8 -4
  118. package/build/libarkts-copy/src/generated/peers/ForInStatement.ts +8 -4
  119. package/build/libarkts-copy/src/generated/peers/ForOfStatement.ts +8 -4
  120. package/build/libarkts-copy/src/generated/peers/ForUpdateStatement.ts +5 -3
  121. package/build/libarkts-copy/src/generated/peers/FunctionDecl.ts +2 -2
  122. package/build/libarkts-copy/src/generated/peers/FunctionDeclaration.ts +11 -5
  123. package/build/libarkts-copy/src/generated/peers/FunctionExpression.ts +11 -5
  124. package/build/libarkts-copy/src/generated/peers/FunctionSignature.ts +2 -2
  125. package/build/libarkts-copy/src/generated/peers/IRNode.ts +2 -2
  126. package/build/libarkts-copy/src/generated/peers/Identifier.ts +14 -6
  127. package/build/libarkts-copy/src/generated/peers/IfStatement.ts +8 -4
  128. package/build/libarkts-copy/src/generated/peers/ImportDeclaration.ts +8 -4
  129. package/build/libarkts-copy/src/generated/peers/ImportDefaultSpecifier.ts +8 -4
  130. package/build/libarkts-copy/src/generated/peers/ImportExpression.ts +8 -4
  131. package/build/libarkts-copy/src/generated/peers/ImportNamespaceSpecifier.ts +8 -4
  132. package/build/libarkts-copy/src/generated/peers/ImportSource.ts +2 -2
  133. package/build/libarkts-copy/src/generated/peers/ImportSpecifier.ts +8 -4
  134. package/build/libarkts-copy/src/generated/peers/IndexInfo.ts +2 -2
  135. package/build/libarkts-copy/src/generated/peers/InterfaceDecl.ts +2 -2
  136. package/build/libarkts-copy/src/generated/peers/LabelPair.ts +2 -2
  137. package/build/libarkts-copy/src/generated/peers/LabelledStatement.ts +8 -4
  138. package/build/libarkts-copy/src/generated/peers/Literal.ts +2 -2
  139. package/build/libarkts-copy/src/generated/peers/LoopStatement.ts +2 -2
  140. package/build/libarkts-copy/src/generated/peers/MaybeOptionalExpression.ts +2 -2
  141. package/build/libarkts-copy/src/generated/peers/MemberExpression.ts +8 -4
  142. package/build/libarkts-copy/src/generated/peers/MetaProperty.ts +8 -4
  143. package/build/libarkts-copy/src/generated/peers/MethodDefinition.ts +23 -7
  144. package/build/libarkts-copy/src/generated/peers/NamedType.ts +8 -4
  145. package/build/libarkts-copy/src/generated/peers/NewExpression.ts +8 -4
  146. package/build/libarkts-copy/src/generated/peers/NullLiteral.ts +8 -4
  147. package/build/libarkts-copy/src/generated/peers/NumberLiteral.ts +17 -7
  148. package/build/libarkts-copy/src/generated/peers/ObjectDescriptor.ts +2 -2
  149. package/build/libarkts-copy/src/generated/peers/ObjectExpression.ts +9 -5
  150. package/build/libarkts-copy/src/generated/peers/OmittedExpression.ts +8 -4
  151. package/build/libarkts-copy/src/generated/peers/OpaqueTypeNode.ts +9 -5
  152. package/build/libarkts-copy/src/generated/peers/OverloadDeclaration.ts +103 -0
  153. package/build/libarkts-copy/src/generated/peers/PrefixAssertionExpression.ts +9 -5
  154. package/build/libarkts-copy/src/generated/peers/Program.ts +4 -2
  155. package/build/libarkts-copy/src/generated/peers/Property.ts +12 -6
  156. package/build/libarkts-copy/src/generated/peers/RegExpLiteral.ts +9 -5
  157. package/build/libarkts-copy/src/generated/peers/ReturnStatement.ts +12 -6
  158. package/build/libarkts-copy/src/generated/peers/ScopeFindResult.ts +2 -2
  159. package/build/libarkts-copy/src/generated/peers/ScriptFunction.ts +47 -14
  160. package/build/libarkts-copy/src/generated/peers/ScriptFunctionData.ts +2 -2
  161. package/build/libarkts-copy/src/generated/peers/SequenceExpression.ts +9 -5
  162. package/build/libarkts-copy/src/generated/peers/SignatureInfo.ts +2 -2
  163. package/build/libarkts-copy/src/generated/peers/SourcePosition.ts +2 -2
  164. package/build/libarkts-copy/src/generated/peers/SourceRange.ts +2 -2
  165. package/build/libarkts-copy/src/generated/peers/SpreadElement.ts +9 -5
  166. package/build/libarkts-copy/src/generated/peers/SrcDumper.ts +2 -2
  167. package/build/libarkts-copy/src/generated/peers/Statement.ts +2 -2
  168. package/build/libarkts-copy/src/generated/peers/StringLiteral.ts +12 -6
  169. package/build/libarkts-copy/src/generated/peers/SuggestionInfo.ts +2 -2
  170. package/build/libarkts-copy/src/generated/peers/SuperExpression.ts +9 -5
  171. package/build/libarkts-copy/src/generated/peers/SwitchCaseStatement.ts +9 -5
  172. package/build/libarkts-copy/src/generated/peers/SwitchStatement.ts +9 -5
  173. package/build/libarkts-copy/src/generated/peers/TSAnyKeyword.ts +9 -5
  174. package/build/libarkts-copy/src/generated/peers/TSArrayType.ts +9 -5
  175. package/build/libarkts-copy/src/generated/peers/TSAsExpression.ts +9 -5
  176. package/build/libarkts-copy/src/generated/peers/TSBigintKeyword.ts +9 -5
  177. package/build/libarkts-copy/src/generated/peers/TSBooleanKeyword.ts +9 -5
  178. package/build/libarkts-copy/src/generated/peers/TSClassImplements.ts +12 -6
  179. package/build/libarkts-copy/src/generated/peers/TSConditionalType.ts +9 -5
  180. package/build/libarkts-copy/src/generated/peers/TSConstructorType.ts +9 -5
  181. package/build/libarkts-copy/src/generated/peers/TSEnumDeclaration.ts +19 -6
  182. package/build/libarkts-copy/src/generated/peers/TSEnumMember.ts +12 -6
  183. package/build/libarkts-copy/src/generated/peers/TSExternalModuleReference.ts +9 -5
  184. package/build/libarkts-copy/src/generated/peers/TSFunctionType.ts +9 -5
  185. package/build/libarkts-copy/src/generated/peers/TSImportEqualsDeclaration.ts +9 -5
  186. package/build/libarkts-copy/src/generated/peers/TSImportType.ts +9 -5
  187. package/build/libarkts-copy/src/generated/peers/TSIndexSignature.ts +9 -5
  188. package/build/libarkts-copy/src/generated/peers/TSIndexedAccessType.ts +9 -5
  189. package/build/libarkts-copy/src/generated/peers/TSInferType.ts +9 -5
  190. package/build/libarkts-copy/src/generated/peers/TSInterfaceBody.ts +9 -5
  191. package/build/libarkts-copy/src/generated/peers/TSInterfaceDeclaration.ts +21 -8
  192. package/build/libarkts-copy/src/generated/peers/TSInterfaceHeritage.ts +9 -5
  193. package/build/libarkts-copy/src/generated/peers/TSIntersectionType.ts +9 -5
  194. package/build/libarkts-copy/src/generated/peers/TSLiteralType.ts +9 -5
  195. package/build/libarkts-copy/src/generated/peers/TSMappedType.ts +9 -5
  196. package/build/libarkts-copy/src/generated/peers/TSMethodSignature.ts +9 -5
  197. package/build/libarkts-copy/src/generated/peers/TSModuleBlock.ts +9 -5
  198. package/build/libarkts-copy/src/generated/peers/TSModuleDeclaration.ts +9 -5
  199. package/build/libarkts-copy/src/generated/peers/TSNamedTupleMember.ts +9 -5
  200. package/build/libarkts-copy/src/generated/peers/TSNeverKeyword.ts +9 -5
  201. package/build/libarkts-copy/src/generated/peers/TSNonNullExpression.ts +9 -5
  202. package/build/libarkts-copy/src/generated/peers/TSNullKeyword.ts +9 -5
  203. package/build/libarkts-copy/src/generated/peers/TSNumberKeyword.ts +9 -5
  204. package/build/libarkts-copy/src/generated/peers/TSObjectKeyword.ts +9 -5
  205. package/build/libarkts-copy/src/generated/peers/TSParameterProperty.ts +9 -5
  206. package/build/libarkts-copy/src/generated/peers/TSParenthesizedType.ts +9 -5
  207. package/build/libarkts-copy/src/generated/peers/TSPropertySignature.ts +9 -5
  208. package/build/libarkts-copy/src/generated/peers/TSQualifiedName.ts +9 -5
  209. package/build/libarkts-copy/src/generated/peers/TSSignatureDeclaration.ts +9 -5
  210. package/build/libarkts-copy/src/generated/peers/TSStringKeyword.ts +9 -5
  211. package/build/libarkts-copy/src/generated/peers/TSThisType.ts +9 -5
  212. package/build/libarkts-copy/src/generated/peers/TSTupleType.ts +9 -5
  213. package/build/libarkts-copy/src/generated/peers/TSTypeAliasDeclaration.ts +42 -11
  214. package/build/libarkts-copy/src/generated/peers/TSTypeAssertion.ts +9 -5
  215. package/build/libarkts-copy/src/generated/peers/TSTypeLiteral.ts +9 -5
  216. package/build/libarkts-copy/src/generated/peers/TSTypeOperator.ts +9 -5
  217. package/build/libarkts-copy/src/generated/peers/TSTypeParameter.ts +12 -6
  218. package/build/libarkts-copy/src/generated/peers/TSTypeParameterDeclaration.ts +9 -5
  219. package/build/libarkts-copy/src/generated/peers/TSTypeParameterInstantiation.ts +9 -5
  220. package/build/libarkts-copy/src/generated/peers/TSTypePredicate.ts +9 -5
  221. package/build/libarkts-copy/src/generated/peers/TSTypeQuery.ts +9 -5
  222. package/build/libarkts-copy/src/generated/peers/TSTypeReference.ts +9 -5
  223. package/build/libarkts-copy/src/generated/peers/TSUndefinedKeyword.ts +9 -5
  224. package/build/libarkts-copy/src/generated/peers/TSUnionType.ts +9 -5
  225. package/build/libarkts-copy/src/generated/peers/TSUnknownKeyword.ts +9 -5
  226. package/build/libarkts-copy/src/generated/peers/TSVoidKeyword.ts +9 -5
  227. package/build/libarkts-copy/src/generated/peers/TaggedTemplateExpression.ts +9 -5
  228. package/build/libarkts-copy/src/generated/peers/TemplateElement.ts +12 -6
  229. package/build/libarkts-copy/src/generated/peers/TemplateLiteral.ts +9 -5
  230. package/build/libarkts-copy/src/generated/peers/ThisExpression.ts +9 -5
  231. package/build/libarkts-copy/src/generated/peers/ThrowStatement.ts +9 -5
  232. package/build/libarkts-copy/src/generated/peers/TryStatement.ts +12 -6
  233. package/build/libarkts-copy/src/generated/peers/TypeNode.ts +2 -2
  234. package/build/libarkts-copy/src/generated/peers/TypedAstNode.ts +2 -2
  235. package/build/libarkts-copy/src/generated/peers/TypedStatement.ts +2 -2
  236. package/build/libarkts-copy/src/generated/peers/TypeofExpression.ts +9 -5
  237. package/build/libarkts-copy/src/generated/peers/UnaryExpression.ts +9 -5
  238. package/build/libarkts-copy/src/generated/peers/UndefinedLiteral.ts +8 -4
  239. package/build/libarkts-copy/src/generated/peers/UpdateExpression.ts +9 -5
  240. package/build/libarkts-copy/src/generated/peers/VReg.ts +2 -2
  241. package/build/libarkts-copy/src/generated/peers/ValidationInfo.ts +2 -2
  242. package/build/libarkts-copy/src/generated/peers/VariableDeclaration.ts +20 -8
  243. package/build/libarkts-copy/src/generated/peers/VariableDeclarator.ts +12 -6
  244. package/build/libarkts-copy/src/generated/peers/VerificationContext.ts +2 -2
  245. package/build/libarkts-copy/src/generated/peers/VerifierMessage.ts +2 -2
  246. package/build/libarkts-copy/src/generated/peers/WhileStatement.ts +9 -5
  247. package/build/libarkts-copy/src/generated/peers/YieldExpression.ts +9 -5
  248. package/build/libarkts-copy/src/index.ts +1 -4
  249. package/build/libarkts-copy/src/plugin-utils.ts +45 -32
  250. package/build/libarkts-copy/src/reexport-for-generated.ts +10 -1
  251. package/build/libarkts-copy/src/ts-api/factory/nodeFactory.ts +14 -14
  252. package/build/libarkts-copy/src/ts-api/index.ts +1 -1
  253. package/build/libarkts-copy/src/ts-api/types.ts +56 -56
  254. package/build/libarkts-copy/src/ts-api/utilities/private.ts +6 -6
  255. package/build/libarkts-copy/src/ts-api/utilities/public.ts +3 -3
  256. package/build/libarkts-copy/src/ts-api/visitor/visitor.ts +4 -4
  257. package/build/libarkts-copy/src/utils.ts +13 -159
  258. package/build/libarkts-copy/src/wrapper-compat/README.md +4 -0
  259. package/build/libarkts-copy/src/wrapper-compat/arkts-api/index.ts +5 -5
  260. package/build/libarkts-copy/src/wrapper-compat/arkts-api/node-utilities/ArrayExpression.ts +1 -1
  261. package/build/libarkts-copy/src/wrapper-compat/arkts-api/node-utilities/ArrowFunctionExpression.ts +1 -1
  262. package/build/libarkts-copy/src/wrapper-compat/arkts-api/node-utilities/AssignmentExpression.ts +1 -1
  263. package/build/libarkts-copy/src/wrapper-compat/arkts-api/node-utilities/BlockStatement.ts +1 -1
  264. package/build/libarkts-copy/src/wrapper-compat/arkts-api/node-utilities/CallExpression.ts +1 -1
  265. package/build/libarkts-copy/src/wrapper-compat/arkts-api/node-utilities/ClassDeclaration.ts +1 -1
  266. package/build/libarkts-copy/src/wrapper-compat/arkts-api/node-utilities/ClassDefinition.ts +2 -2
  267. package/build/libarkts-copy/src/wrapper-compat/arkts-api/node-utilities/ClassProperty.ts +1 -1
  268. package/build/libarkts-copy/src/wrapper-compat/arkts-api/node-utilities/ETSFunctionType.ts +2 -2
  269. package/build/libarkts-copy/src/wrapper-compat/arkts-api/node-utilities/ETSImportDeclaration.ts +2 -2
  270. package/build/libarkts-copy/src/wrapper-compat/arkts-api/node-utilities/ETSParameterExpression.ts +2 -2
  271. package/build/libarkts-copy/src/wrapper-compat/arkts-api/node-utilities/ExpressionStatement.ts +1 -1
  272. package/build/libarkts-copy/src/wrapper-compat/arkts-api/node-utilities/FunctionDeclaration.ts +1 -1
  273. package/build/libarkts-copy/src/wrapper-compat/arkts-api/node-utilities/FunctionExpression.ts +1 -1
  274. package/build/libarkts-copy/src/wrapper-compat/arkts-api/node-utilities/IfStatement.ts +1 -1
  275. package/build/libarkts-copy/src/wrapper-compat/arkts-api/node-utilities/MemberExpression.ts +1 -1
  276. package/build/libarkts-copy/src/wrapper-compat/arkts-api/node-utilities/MethodDefinition.ts +2 -2
  277. package/build/libarkts-copy/src/wrapper-compat/arkts-api/node-utilities/NumberLiteral.ts +2 -2
  278. package/build/libarkts-copy/src/wrapper-compat/arkts-api/node-utilities/ObjectExpression.ts +3 -3
  279. package/build/libarkts-copy/src/wrapper-compat/arkts-api/node-utilities/Property.ts +1 -1
  280. package/build/libarkts-copy/src/wrapper-compat/arkts-api/node-utilities/ScriptFunction.ts +1 -1
  281. package/build/libarkts-copy/src/wrapper-compat/arkts-api/node-utilities/StructDeclaration.ts +1 -1
  282. package/build/libarkts-copy/src/wrapper-compat/arkts-api/node-utilities/TSInterfaceDeclaration.ts +1 -1
  283. package/build/libarkts-copy/src/wrapper-compat/arkts-api/node-utilities/TSTypeAliasDeclaration.ts +1 -1
  284. package/build/libarkts-copy/src/wrapper-compat/arkts-api/node-utilities/TSTypeParameter.ts +1 -1
  285. package/build/libarkts-copy/src/wrapper-compat/arkts-api/node-utilities/TryStatement.ts +3 -3
  286. package/build/libarkts-copy/src/wrapper-compat/arkts-api/node-utilities/VariableDeclaration.ts +1 -1
  287. package/build/libarkts-copy/src/wrapper-compat/arkts-api/node-utilities/VariableDeclarator.ts +2 -2
  288. package/build/libarkts-copy/src/wrapper-compat/arkts-api/peers/Diagnostic.ts +4 -5
  289. package/build/libarkts-copy/src/wrapper-compat/arkts-api/peers/DiagnosticInfo.ts +4 -3
  290. package/build/libarkts-copy/src/wrapper-compat/arkts-api/peers/DiagnosticKind.ts +1 -1
  291. package/build/libarkts-copy/src/wrapper-compat/arkts-api/peers/ImportPathManager.ts +2 -2
  292. package/build/libarkts-copy/src/wrapper-compat/arkts-api/peers/Program.ts +1 -1
  293. package/build/libarkts-copy/src/wrapper-compat/arkts-api/peers/SourcePosition.ts +2 -2
  294. package/build/libarkts-copy/src/wrapper-compat/arkts-api/peers/SourceRange.ts +2 -2
  295. package/build/libarkts-copy/src/wrapper-compat/arkts-api/peers/SuggestionInfo.ts +4 -3
  296. package/build/libarkts-copy/src/wrapper-compat/arkts-api/to-be-generated/MemberExpression.ts +1 -1
  297. package/build/libarkts-copy/src/wrapper-compat/arkts-api/types.ts +12 -30
  298. package/build/libarkts-copy/src/wrapper-compat/arkts-api/utilities/nativePtrDecoder.ts +1 -1
  299. package/build/libarkts-copy/src/wrapper-compat/arkts-api/utilities/private.ts +4 -4
  300. package/build/libarkts-copy/src/wrapper-compat/arkts-api/utilities/public.ts +10 -8
  301. package/build/libarkts-copy/src/wrapper-compat/arkts-api/visitor.ts +10 -10
  302. package/lib/index.js +2799 -2665
  303. package/package.json +2 -2
  304. package/templates/Es2pandaEnums.ts +1 -2
  305. package/templates/Es2pandaNativeModule.ts +2 -3
  306. package/templates/factory.ts +1 -2
  307. package/templates/index.ts +1 -2
  308. package/templates/node-map.ts +1 -2
  309. package/templates/peer.ts +1 -2
  310. package/build/libarkts-copy/src/arkts-api/CheckedBackFilter.ts +0 -131
  311. package/build/libarkts-copy/src/arkts-api/CompileWithCache.ts +0 -193
  312. package/build/libarkts-copy/src/arkts-api/InferVoidReturnType.ts +0 -89
  313. package/build/libarkts-copy/src/arkts-api/SetBaseOverloads.ts +0 -44
  314. package/build/libarkts-copy/src/arkts-api/node-utilities/AnnotationUsage.ts +0 -29
  315. package/build/libarkts-copy/src/arkts-api/node-utilities/ArrowFunctionExpression.ts +0 -49
  316. package/build/libarkts-copy/src/arkts-api/node-utilities/ClassDeclaration.ts +0 -54
  317. package/build/libarkts-copy/src/arkts-api/node-utilities/TSTypeAliasDeclaration.ts +0 -68
  318. package/build/libarkts-copy/src/arkts-api/node-utilities/VariableDeclaration.ts +0 -54
  319. package/build/libarkts-copy/src/arkts-api/utilities/method-definition.ts +0 -38
  320. package/build/libarkts-copy/src/wrapper-compat/arkts-api/peers/ArktsObject.ts +0 -45
  321. package/build/libarkts-copy/src/wrapper-compat/arkts-api/peers/Config.ts +0 -53
  322. package/build/libarkts-copy/src/wrapper-compat/arkts-api/peers/Context.ts +0 -60
@@ -253,7 +253,16 @@
253
253
  types: ["returnType"]
254
254
  }
255
255
  ]
256
- }
256
+ },
257
+ {
258
+ name: "ClassDeclaration",
259
+ methods: [
260
+ {
261
+ name: "Definition",
262
+ types: ["returnType"]
263
+ }
264
+ ]
265
+ },
257
266
  ],
258
267
  fragments: [
259
268
  {
@@ -261,13 +270,166 @@
261
270
  methods: [
262
271
  {
263
272
  name: "setChildrenParentPtr",
264
- definition: "methodDefinitionSetChildrenParentPtr",
273
+ definition: "extension_MethodDefinitionSetChildrenParentPtr",
265
274
  },
266
275
  {
267
276
  name: "onUpdate",
268
- definition: "methodDefinitionOnUpdate",
277
+ definition: "extension_MethodDefinitionOnUpdate",
269
278
  },
270
279
  ]
271
280
  },
281
+ {
282
+ interface: "ETSModule",
283
+ methods: [
284
+ {
285
+ name: "getNamespaceFlag",
286
+ definition: "extension_ETSModuleGetNamespaceFlag",
287
+ }
288
+ ]
289
+ },
290
+ {
291
+ interface: "ScriptFunction",
292
+ methods: [
293
+ {
294
+ name: "getSignaturePointer",
295
+ definition: "extension_ScriptFunctionGetSignaturePointer",
296
+ },
297
+ {
298
+ name: "setSignaturePointer",
299
+ definition: "extension_ScriptFunctionSetSignaturePointer",
300
+ },
301
+ {
302
+ name: "getPreferredReturnTypePointer",
303
+ definition: "extension_ScriptFunctionGetPreferredReturnTypePointer",
304
+ },
305
+ {
306
+ name: "setPreferredReturnTypePointer",
307
+ definition: "extension_ScriptFunctionSetPreferredReturnTypePointer",
308
+ },
309
+ ]
310
+ },
311
+ {
312
+ interface: "Program",
313
+ methods: [
314
+ {
315
+ name: "getExternalSources",
316
+ definition: "extension_ProgramGetExternalSources",
317
+ },
318
+ ],
319
+ }
320
+ ],
321
+ parameters: [
322
+ {
323
+ interface: "ArrowFunctionExpression",
324
+ parameters: [
325
+ {
326
+ name: "annotations",
327
+ },
328
+ ],
329
+ },
330
+ {
331
+ interface: "CallExpression",
332
+ parameters: [
333
+ {
334
+ name: "trailingBlock",
335
+ },
336
+ ],
337
+ },
338
+ {
339
+ interface: "ClassDeclaration",
340
+ parameters: [
341
+ {
342
+ name: "modifierFlags",
343
+ },
344
+ ],
345
+ },
346
+ {
347
+ interface: "ClassDefinition",
348
+ parameters: [
349
+ {
350
+ name: "annotations",
351
+ },
352
+ ],
353
+ },
354
+ {
355
+ interface: "ClassProperty",
356
+ parameters: [
357
+ {
358
+ name: "annotations",
359
+ },
360
+ ],
361
+ },
362
+ {
363
+ interface: "ETSFunctionType",
364
+ parameters: [
365
+ {
366
+ name: "annotations",
367
+ },
368
+ ],
369
+ },
370
+ {
371
+ interface: "ETSParameterExpression",
372
+ parameters: [
373
+ {
374
+ name: "annotations",
375
+ },
376
+ ],
377
+ },
378
+ {
379
+ interface: "ETSUnionType",
380
+ parameters: [
381
+ {
382
+ name: "annotations",
383
+ },
384
+ ],
385
+ },
386
+ {
387
+ interface: "MethodDefinition",
388
+ parameters: [
389
+ {
390
+ name: "overloads",
391
+ },
392
+ ],
393
+ },
394
+ {
395
+ interface: "ScriptFunction",
396
+ parameters: [
397
+ {
398
+ name: "ident",
399
+ setter: "setIdent",
400
+ getter: "id",
401
+ },
402
+ {
403
+ name: "annotations",
404
+ },
405
+ ],
406
+ },
407
+ {
408
+ interface: "TSInterfaceDeclaration",
409
+ parameters: [
410
+ {
411
+ name: "modifierFlags",
412
+ },
413
+ ],
414
+ },
415
+ {
416
+ interface: "TSTypeAliasDeclaration",
417
+ parameters: [
418
+ {
419
+ name: "annotations",
420
+ },
421
+ {
422
+ name: "modifierFlags",
423
+ },
424
+ ],
425
+ },
426
+ {
427
+ interface: "VariableDeclaration",
428
+ parameters: [
429
+ {
430
+ name: "annotations",
431
+ },
432
+ ],
433
+ },
272
434
  ],
273
435
  }
@@ -20,6 +20,7 @@ project(
20
20
  'buildtype=release',
21
21
  ],
22
22
  )
23
+ is_cross = get_option('cross_compile')
23
24
 
24
25
  sources = [
25
26
  './src/common.cc',
@@ -28,7 +29,7 @@ sources = [
28
29
  get_option('interop_src_dir') / 'common-interop.cc',
29
30
  get_option('interop_src_dir') / 'callback-resource.cc',
30
31
  get_option('interop_src_dir') / 'interop-logging.cc',
31
- get_option('interop_src_dir') / 'napi/convertors-napi.cc',
32
+ get_option('interop_src_dir') / 'napi' / 'convertors-napi.cc',
32
33
  ]
33
34
 
34
35
  cflags = [
@@ -38,14 +39,12 @@ cflags = [
38
39
  '-DKOALA_NAPI',
39
40
  ]
40
41
 
41
- if (target_machine.system() == 'windows')
42
+ if (host_machine.system() == 'windows')
42
43
  cflags += ['-DKOALA_WINDOWS']
43
- if (meson.get_compiler('cpp').get_id() == 'msvc')
44
- # apply node.exe symbol loading hook
45
- sources += [
46
- get_option('interop_src_dir') / 'napi/win-dynamic-node.cc'
47
- ]
48
- endif
44
+ # apply node.exe symbol loading hook
45
+ sources += [
46
+ get_option('interop_src_dir') / 'napi/win-dynamic-node.cc'
47
+ ]
49
48
  else
50
49
  cflags += ['-DKOALA_LINUX']
51
50
  endif
@@ -62,17 +61,17 @@ arch = archs.get(arch, arch)
62
61
 
63
62
  cflags_cross = []
64
63
  cflags_host = []
65
- suffix_host = '_' + arch
64
+ suffix_host = '_' + os + '_' + arch
66
65
  suffix_cross = ''
67
66
 
68
67
  if get_option('cross_compile')
69
68
  if arch == 'arm64'
70
69
  cflags_cross = ['--target=x86_64-linux-gnu']
71
- suffix_cross = '_x64'
70
+ suffix_cross = '_' + os + '_x64'
72
71
  endif
73
72
  if arch == 'x64'
74
73
  cflags_cross = ['--target=aarch64-linux-gnu']
75
- suffix_cross = '_arm64'
74
+ suffix_cross = '_' + os + '_arm64'
76
75
  endif
77
76
  endif
78
77
 
@@ -100,7 +99,7 @@ shared_library(
100
99
  dependencies: []
101
100
  )
102
101
 
103
- if get_option('cross_compile')
102
+ if is_cross
104
103
  # sudo apt install g++-aarch64-linux-gnu binutils-aarch64-linux-gnu
105
104
  shared_library(
106
105
  get_option('lib_name') + suffix_cross,
@@ -40,4 +40,4 @@ option(
40
40
  type : 'boolean',
41
41
  value : false,
42
42
  description : 'whether to build binaries for all architectures or just for current'
43
- )
43
+ )
@@ -0,0 +1,14 @@
1
+ [binaries]
2
+ c = 'x86_64-w64-mingw32-gcc'
3
+ cpp = 'x86_64-w64-mingw32-g++'
4
+ ar = 'x86_64-w64-mingw32-ar'
5
+ windres = 'x86_64-w64-mingw32-windres'
6
+ strip = 'x86_64-w64-mingw32-strip'
7
+ exe_wrapper = 'wine64'
8
+
9
+ [host_machine]
10
+ system = 'windows'
11
+ cpu_family = 'x86_64'
12
+ cpu = 'x86_64'
13
+ endian = 'little'
14
+
@@ -190,6 +190,14 @@ KNativePointer impl_ContextErrorMessage(KNativePointer contextPtr)
190
190
  }
191
191
  KOALA_INTEROP_1(ContextErrorMessage, KNativePointer, KNativePointer)
192
192
 
193
+ KNativePointer impl_GetAllErrorMessages(KNativePointer contextPtr)
194
+ {
195
+ auto context = reinterpret_cast<es2panda_Context*>(contextPtr);
196
+
197
+ return StageArena::strdup(GetImpl()->GetAllErrorMessages(context));
198
+ }
199
+ KOALA_INTEROP_1(GetAllErrorMessages, KNativePointer, KNativePointer)
200
+
193
201
  /*
194
202
  KNativePointer impl_CallExpressionSignature(KNativePointer context, KNativePointer classInstance)
195
203
  {
@@ -394,15 +402,83 @@ void impl_DestroyGlobalContext(KNativePointer globalContextPtr) {
394
402
  }
395
403
  KOALA_INTEROP_V1(DestroyGlobalContext, KNativePointer)
396
404
 
405
+ // All these "Checker_" bridges are related to checker namespace in es2panda, so work with them carefully
406
+ // Checker.Type does reset on recheck, so modifying them makes no sence
407
+ // It seems that compiler does not provide API to convert Checker.Type to ir.Type
408
+ KNativePointer impl_Checker_ScriptFunctionSignature(KNativePointer context, KNativePointer node)
409
+ {
410
+ auto _context = reinterpret_cast<es2panda_Context*>(context);
411
+ auto _node = reinterpret_cast<es2panda_AstNode*>(node);
412
+ return GetImpl()->ScriptFunctionSignature(_context, _node);
413
+ }
414
+ KOALA_INTEROP_2(Checker_ScriptFunctionSignature, KNativePointer, KNativePointer, KNativePointer)
415
+
416
+ void impl_Checker_ScriptFunctionSetSignature(KNativePointer context, KNativePointer node, KNativePointer signature)
417
+ {
418
+ auto _context = reinterpret_cast<es2panda_Context*>(context);
419
+ auto _node = reinterpret_cast<es2panda_AstNode*>(node);
420
+ auto _signature = reinterpret_cast<es2panda_Signature*>(signature);
421
+ GetImpl()->ScriptFunctionSetSignature(_context, _node, _signature);
422
+ return;
423
+ }
424
+ KOALA_INTEROP_V3(Checker_ScriptFunctionSetSignature, KNativePointer, KNativePointer, KNativePointer)
425
+
426
+ KNativePointer impl_Checker_SignatureReturnType(KNativePointer context, KNativePointer signature)
427
+ {
428
+ auto _context = reinterpret_cast<es2panda_Context*>(context);
429
+ auto _signature = reinterpret_cast<es2panda_Signature*>(signature);
430
+ return GetImpl()->SignatureReturnType(_context, _signature);
431
+ }
432
+ KOALA_INTEROP_2(Checker_SignatureReturnType, KNativePointer, KNativePointer, KNativePointer)
433
+
434
+ KNativePointer impl_Checker_ScriptFunctionGetPreferredReturnType(KNativePointer context, KNativePointer node)
435
+ {
436
+ auto _context = reinterpret_cast<es2panda_Context*>(context);
437
+ auto _node = reinterpret_cast<es2panda_AstNode*>(node);
438
+ return GetImpl()->ScriptFunctionGetPreferredReturnType(_context, _node);
439
+ }
440
+ KOALA_INTEROP_2(Checker_ScriptFunctionGetPreferredReturnType, KNativePointer, KNativePointer, KNativePointer)
441
+
442
+ void impl_Checker_ScriptFunctionSetPreferredReturnType(KNativePointer context, KNativePointer node, KNativePointer type)
443
+ {
444
+ auto _context = reinterpret_cast<es2panda_Context*>(context);
445
+ auto _node = reinterpret_cast<es2panda_AstNode*>(node);
446
+ auto _type = reinterpret_cast<es2panda_Type*>(type);
447
+ GetImpl()->ScriptFunctionSetPreferredReturnType(_context, _node, _type);
448
+ return;
449
+ }
450
+ KOALA_INTEROP_V3(Checker_ScriptFunctionSetPreferredReturnType, KNativePointer, KNativePointer, KNativePointer)
451
+
452
+ KNativePointer impl_Checker_TypeToString(KNativePointer context, KNativePointer type)
453
+ {
454
+ auto _context = reinterpret_cast<es2panda_Context*>(context);
455
+ auto _type = reinterpret_cast<es2panda_Type*>(type);
456
+ auto result = GetImpl()->TypeToStringConst(_context, _type);
457
+ return StageArena::strdup(result);
458
+ }
459
+ KOALA_INTEROP_2(Checker_TypeToString, KNativePointer, KNativePointer, KNativePointer)
460
+
461
+ KNativePointer impl_Checker_TypeNodeGetType(KNativePointer context, KNativePointer astNode)
462
+ {
463
+ auto _context = reinterpret_cast<es2panda_Context*>(context);
464
+ auto _astNode = reinterpret_cast<es2panda_AstNode*>(astNode);
465
+ return GetImpl()->TypeNodeGetType(_context, _astNode);
466
+ }
467
+ KOALA_INTEROP_2(Checker_TypeNodeGetType, KNativePointer, KNativePointer, KNativePointer)
468
+
397
469
  // From koala-wrapper
398
- // TODO check if some code should be generated
470
+ // Improve: check if some code should be generated
399
471
 
400
472
  std::set<std::string> globalStructInfo;
473
+ #ifdef _GLIBCXX_HAS_GTHREADS
401
474
  std::mutex g_structMutex;
475
+ #endif
402
476
 
403
477
  void impl_InsertGlobalStructInfo(KNativePointer contextPtr, KStringPtr& instancePtr)
404
478
  {
479
+ #ifdef _GLIBCXX_HAS_GTHREADS
405
480
  std::lock_guard<std::mutex> lock(g_structMutex);
481
+ #endif
406
482
  globalStructInfo.insert(getStringCopy(instancePtr));
407
483
  return;
408
484
  }
@@ -410,7 +486,9 @@ KOALA_INTEROP_V2(InsertGlobalStructInfo, KNativePointer, KStringPtr);
410
486
 
411
487
  KBoolean impl_HasGlobalStructInfo(KNativePointer contextPtr, KStringPtr& instancePtr)
412
488
  {
489
+ #ifdef _GLIBCXX_HAS_GTHREADS
413
490
  std::lock_guard<std::mutex> lock(g_structMutex);
491
+ #endif
414
492
  return globalStructInfo.count(getStringCopy(instancePtr));
415
493
  }
416
494
  KOALA_INTEROP_2(HasGlobalStructInfo, KBoolean, KNativePointer, KStringPtr);
@@ -501,10 +579,12 @@ KNativePointer impl_CreateDiagnosticKind(KNativePointer context, KStringPtr& mes
501
579
  }
502
580
  KOALA_INTEROP_3(CreateDiagnosticKind, KNativePointer, KNativePointer, KStringPtr, KInt)
503
581
 
504
- KNativePointer impl_CreateDiagnosticInfo(KNativePointer context, KNativePointer kind, KStringArray argsPtr, KInt argc)
582
+ KNativePointer impl_CreateDiagnosticInfo(KNativePointer context, KNativePointer kind, KStringArray argsPtr,
583
+ KInt argc, KNativePointer pos)
505
584
  {
506
585
  const auto _context = reinterpret_cast<es2panda_Context*>(context);
507
586
  const auto _kind = reinterpret_cast<es2panda_DiagnosticKind*>(kind);
587
+ const auto _pos = reinterpret_cast<es2panda_SourcePosition *>(pos);
508
588
  const std::size_t headerLen = 4;
509
589
  const char** _args = new const char*[argc];
510
590
  std::size_t position = headerLen;
@@ -515,15 +595,17 @@ KNativePointer impl_CreateDiagnosticInfo(KNativePointer context, KNativePointer
515
595
  _args[i] = strdup(std::string(reinterpret_cast<const char*>(argsPtr + position), strLen).c_str());
516
596
  position += strLen;
517
597
  }
518
- return GetImpl()->CreateDiagnosticInfo(_context, _kind, _args, argc);
598
+ return GetImpl()->CreateDiagnosticInfo(_context, _kind, _args, argc, _pos);
519
599
  }
520
- KOALA_INTEROP_4(CreateDiagnosticInfo, KNativePointer, KNativePointer, KNativePointer, KStringArray, KInt)
600
+ KOALA_INTEROP_5(CreateDiagnosticInfo, KNativePointer, KNativePointer, KNativePointer,
601
+ KStringArray, KInt, KNativePointer)
521
602
 
522
603
  KNativePointer impl_CreateSuggestionInfo(KNativePointer context, KNativePointer kind, KStringArray argsPtr,
523
- KInt argc, KStringPtr& substitutionCode)
604
+ KInt argc, KStringPtr& substitutionCode, KNativePointer range)
524
605
  {
525
606
  const auto _context = reinterpret_cast<es2panda_Context*>(context);
526
607
  const auto _kind = reinterpret_cast<es2panda_DiagnosticKind *>(kind);
608
+ const auto _range = reinterpret_cast<es2panda_SourceRange *>(range);
527
609
  const std::size_t headerLen = 4;
528
610
  const char** _args = new const char*[argc];
529
611
  std::size_t position = headerLen;
@@ -535,9 +617,9 @@ KNativePointer impl_CreateSuggestionInfo(KNativePointer context, KNativePointer
535
617
  position += strLen;
536
618
  }
537
619
  const auto _substitutionCode = getStringCopy(substitutionCode);
538
- return GetImpl()->CreateSuggestionInfo(_context, _kind, _args, argc, _substitutionCode);
620
+ return GetImpl()->CreateSuggestionInfo(_context, _kind, _args, argc, _substitutionCode, _range);
539
621
  }
540
- KOALA_INTEROP_5(CreateSuggestionInfo, KNativePointer, KNativePointer, KNativePointer, KStringArray, KInt, KStringPtr)
622
+ KOALA_INTEROP_6(CreateSuggestionInfo, KNativePointer, KNativePointer, KNativePointer, KStringArray, KInt, KStringPtr, KNativePointer)
541
623
 
542
624
  void impl_LogDiagnostic(KNativePointer context, KNativePointer kind, KStringArray argvPtr,
543
625
  KInt argc, KNativePointer pos)
@@ -560,15 +642,14 @@ void impl_LogDiagnostic(KNativePointer context, KNativePointer kind, KStringArra
560
642
  KOALA_INTEROP_V5(LogDiagnostic, KNativePointer, KNativePointer, KStringArray, KInt, KNativePointer)
561
643
 
562
644
  void impl_LogDiagnosticWithSuggestion(KNativePointer context, KNativePointer diagnosticInfo,
563
- KNativePointer suggestionInfo, KNativePointer range)
645
+ KNativePointer suggestionInfo)
564
646
  {
565
647
  const auto _context = reinterpret_cast<es2panda_Context*>(context);
566
648
  const auto _diagnosticInfo = reinterpret_cast<es2panda_DiagnosticInfo*>(diagnosticInfo);
567
649
  const auto _suggestionInfo = reinterpret_cast<es2panda_SuggestionInfo*>(suggestionInfo);
568
- const auto _range = reinterpret_cast<es2panda_SourceRange*>(range);
569
- GetImpl()->LogDiagnosticWithSuggestion(_context, _diagnosticInfo, _suggestionInfo, _range);
650
+ GetImpl()->LogDiagnosticWithSuggestion(_context, _diagnosticInfo, _suggestionInfo);
570
651
  }
571
- KOALA_INTEROP_V4(LogDiagnosticWithSuggestion, KNativePointer, KNativePointer, KNativePointer, KNativePointer)
652
+ KOALA_INTEROP_V3(LogDiagnosticWithSuggestion, KNativePointer, KNativePointer, KNativePointer)
572
653
 
573
654
  KInt impl_GenerateStaticDeclarationsFromContext(KNativePointer contextPtr, KStringPtr &outputPath)
574
655
  {
@@ -588,14 +669,14 @@ KNativePointer impl_AnnotationUsageIrPropertiesPtrConst(KNativePointer context,
588
669
  KOALA_INTEROP_2(AnnotationUsageIrPropertiesPtrConst, KNativePointer, KNativePointer, KNativePointer);
589
670
 
590
671
  KInt impl_GenerateTsDeclarationsFromContext(KNativePointer contextPtr, KStringPtr &outputDeclEts, KStringPtr &outputEts,
591
- KBoolean exportAll, KBoolean isolated)
672
+ KBoolean exportAll, KBoolean isolated, KStringPtr &recordFile)
592
673
  {
593
674
  auto context = reinterpret_cast<es2panda_Context *>(contextPtr);
594
- return GetImpl()->GenerateTsDeclarationsFromContext(context, outputDeclEts.data(), outputEts.data(), exportAll, isolated );
675
+ return GetImpl()->GenerateTsDeclarationsFromContext(context, outputDeclEts.data(), outputEts.data(), exportAll, isolated, recordFile.data() );
595
676
  }
596
- KOALA_INTEROP_5(GenerateTsDeclarationsFromContext, KInt, KNativePointer, KStringPtr, KStringPtr, KBoolean, KBoolean)
677
+ KOALA_INTEROP_6(GenerateTsDeclarationsFromContext, KInt, KNativePointer, KStringPtr, KStringPtr, KBoolean, KBoolean, KStringPtr)
597
678
 
598
- // TODO: simplify
679
+ // Improve: simplify
599
680
  KNativePointer impl_CreateContextGenerateAbcForExternalSourceFiles(
600
681
  KNativePointer configPtr, KInt fileNamesCount, KStringArray fileNames)
601
682
  {
@@ -618,3 +699,12 @@ KNativePointer impl_CreateContextGenerateAbcForExternalSourceFiles(
618
699
  config, fileNamesCount, argv);
619
700
  }
620
701
  KOALA_INTEROP_3(CreateContextGenerateAbcForExternalSourceFiles, KNativePointer, KNativePointer, KInt, KStringArray)
702
+
703
+ KNativePointer impl_JsdocStringFromDeclaration(KNativePointer contextPtr, KNativePointer nodePtr)
704
+ {
705
+ auto context = reinterpret_cast<es2panda_Context*>(contextPtr);
706
+ auto node = reinterpret_cast<es2panda_AstNode*>(nodePtr);
707
+ return StageArena::strdup(GetImpl()->JsdocStringFromDeclaration(context, node));
708
+ }
709
+ KOALA_INTEROP_2(JsdocStringFromDeclaration, KNativePointer, KNativePointer, KNativePointer)
710
+
@@ -15,6 +15,7 @@
15
15
 
16
16
  #include <common.h>
17
17
  #include <utility>
18
+ #include "interop-types.h"
18
19
 
19
20
  using std::string, std::cout, std::endl, std::vector;
20
21
 
@@ -58,13 +59,16 @@ char* StageArena::strdup(const char* string)
58
59
  auto* arena = StageArena::instance();
59
60
  auto size = strlen(string) + 1;
60
61
  char* memory = (char*)arena->alloc(size);
61
- memcpy(memory, string, size);
62
+ interop_memcpy(memory, size, string, size);
62
63
  return memory;
63
64
  }
64
65
 
65
66
  void* StageArena::alloc(size_t size)
66
67
  {
67
68
  void* result = malloc(size);
69
+ if (!result) {
70
+ INTEROP_FATAL("Cannot allocate memory");
71
+ }
68
72
  totalSize += size;
69
73
  add(result);
70
74
  return result;
@@ -127,11 +131,11 @@ void impl_SetUpSoPath(KStringPtr &soPath)
127
131
  }
128
132
  KOALA_INTEROP_V1(SetUpSoPath, KStringPtr);
129
133
 
130
- // todo: simplify this
134
+ // Improve: simplify this
131
135
  void* FindLibrary() {
132
- void *res = NULL;
136
+ void *res = nullptr;
133
137
  std::vector<std::string> pathArray;
134
-
138
+
135
139
  // find by SetUpSoPath
136
140
  if (!ES2PANDA_LIB_PATH.empty()) {
137
141
  pathArray = {ES2PANDA_LIB_PATH, LIB_DIR, LIB_ES2PANDA_PUBLIC};
@@ -165,7 +169,7 @@ void* FindLibrary() {
165
169
  return res;
166
170
  }
167
171
 
168
- return NULL;
172
+ return nullptr;
169
173
  }
170
174
 
171
175
  es2panda_Impl *GetImplSlow()
@@ -270,7 +274,7 @@ KInt impl_IdentifierIdentifierFlags(KNativePointer contextPtr, KNativePointer no
270
274
  KOALA_INTEROP_2(IdentifierIdentifierFlags, KInt, KNativePointer, KNativePointer)
271
275
 
272
276
  /*
273
- TODO: NOT FROM API (shouldn't be there)
277
+ Improve: NOT FROM API (shouldn't be there)
274
278
  -----------------------------------------------------------------------------------------------------------------------------
275
279
  */
276
280
 
@@ -336,7 +340,7 @@ KOALA_INTEROP_2(AstNodeChildren, KNativePointer, KNativePointer, KNativePointer)
336
340
  */
337
341
 
338
342
  // From koala-wrapper
339
- // TODO check if some code should be generated
343
+ // Improve: check if some code should be generated
340
344
 
341
345
  void impl_MemInitialize()
342
346
  {
@@ -35,6 +35,7 @@
35
35
  #include "es2panda_lib.h"
36
36
  #include "common-interop.h"
37
37
  #include "stdexcept"
38
+ #include "interop-utils.h"
38
39
  #include <string>
39
40
  #include <iostream>
40
41
  #include <vector>