mirror of
https://github.com/openharmony/ark_ts2abc.git
synced 2026-07-21 00:05:28 -04:00
aeface1b7fdaff2ed85ffa5d29014e1f1d08f40f
Merge pull request !235 from hufeng/fix_minus_zero_element
ts2abc
Introduction
ts2abc is a front-end tool in the ARK Runtime Subsystem. It converts JavaScript(JS) files into ARK bytecode files.
For more information, see: ARK Runtime Subsystem.
Directory Structure
/ark/ts2abc/
├── test262 # scripts for configuration and running Test262
├── testTs # system test cases
├── ts2panda
├── scripts # dependency scripts
├── src # source code directory
├── templates # ruby templates
├── tests # unit test cases
├── tools # tools provided by ts2abc
└── ts2abc # ts2abc source code
Build
ts2abc uses the command line interaction mode and converts JS code into ARK bytecode files that can be run on an ARK runtime system. ts2abc supports Windows, Linux, and macOS. Front-end tools, converting JS source code into ARK bytecode, can be built by specifying the --build-target with ark_ts2abc on Linux.
$ ./build.sh --product-name Hi3516DV300 --build-target ark_ts2abc_build
Usage Guidelines
Install node and npm
convert JS to ARK bytecode
$ cd out//hi3516dv300/clang_x64/ark/ark/build
$ npm install
$ node --expose-gc src/index.js [options] file.js
If no parameter is specified for [options], an ARK binary file is generated by default.
For more information, please see: ARK-Runtime-Usage-Guide.
Repositories Involved
Description
Languages
C++
49.9%
TypeScript
42.5%
Python
2.9%
JavaScript
2.5%
HTML
0.9%
Other
1.3%