diff --git a/es2panda/es2abc_config.gni b/es2panda/es2abc_config.gni index c46973d59682dd7887b1c19d050cb98098160ced..6a14c16732c8afe92d798ac39123de08682029e9 100644 --- a/es2panda/es2abc_config.gni +++ b/es2panda/es2abc_config.gni @@ -71,6 +71,19 @@ template("es2abc_gen_abc") { rebase_path("${es2abc_build_path}"), ] + if (defined(invoker.dump_symbol_table)) { + args += [ + "--dump-symbol-table", + invoker.dump_symbol_table, + ] + } + if (defined(invoker.input_symbol_table)) { + args += [ + "--input-symbol-table", + invoker.input_symbol_table, + ] + } + if (defined(invoker.extra_args)) { args += invoker.extra_args } diff --git a/es2panda/scripts/generate_js_bytecode.py b/es2panda/scripts/generate_js_bytecode.py index 0371d9239ba24213a0be11c00be41e9fd24842e9..60b205472224e63eafbafa8b958b0be9c6d02f2e 100755 --- a/es2panda/scripts/generate_js_bytecode.py +++ b/es2panda/scripts/generate_js_bytecode.py @@ -40,6 +40,12 @@ def parse_args(): help='whether is commonjs') parser.add_argument("--merge-abc", action='store_true', help='whether is merge abc') + parser.add_argument("--generate-patch", action='store_false', + help='generate patch abc') + parser.add_argument("--dump-symbol-table", + help='dump symbol table of base abc') + parser.add_argument("--input-symbol-table", + help='input symbol table for patch abc') arguments = parser.parse_args() return arguments @@ -58,6 +64,10 @@ def gen_abc_info(input_arguments): '--output', input_arguments.dst_file, input_arguments.src_js] + if input_arguments.dump_symbol_table: + cmd += ['--dump-symbol-table', input_arguments.dump_symbol_table] + if input_arguments.input_symbol_table: + cmd += ['--input-symbol-table', input_arguments.input_symbol_table] if input_arguments.debug: src_index = cmd.index(input_arguments.src_js) cmd.insert(src_index, '--debug-info') @@ -70,6 +80,9 @@ def gen_abc_info(input_arguments): if input_arguments.merge_abc: src_index = cmd.index(input_arguments.src_js) cmd.insert(src_index, '--merge-abc') + if input_arguments.generate_patch: + src_index = cmd.index(input_arguments.src_js) + cmd.insert(src_index, '--generate-patch') # insert d.ts option to cmd later run_command(cmd, path)