From ad4e268dc820d50c839881fbb741b8c987940b5d Mon Sep 17 00:00:00 2001 From: changjiaxing Date: Mon, 4 Jul 2022 10:52:37 +0800 Subject: [PATCH] Add tonumeric instruction issue:Issuehttps://gitee.com/openharmony/ark_js_runtime/issues/I5F9F6?from=project-issue Signed-off-by: changjiaxing --- test262/es2021_tests.txt | 8 +++++++- ts2panda/src/compiler.ts | 2 +- ts2panda/src/pandagen.ts | 5 +++++ 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/test262/es2021_tests.txt b/test262/es2021_tests.txt index 4b4c272279..e24c362d99 100644 --- a/test262/es2021_tests.txt +++ b/test262/es2021_tests.txt @@ -353,4 +353,10 @@ built-ins/Promise/prototype/finally/this-value-proxy.js built-ins/Promise/prototype/finally/this-value-then-poisoned.js built-ins/Promise/prototype/finally/this-value-then-throws.js built-ins/Promise/prototype/finally/this-value-thenable.js -built-ins/Promise/prototype/finally/this-value-then-not-callable.js \ No newline at end of file +built-ins/Promise/prototype/finally/this-value-then-not-callable.js +built-ins/JSON/stringify/value-bigint.js +built-ins/JSON/stringify/value-bigint-cross-realm.js +built-ins/JSON/stringify/value-bigint-order.js +built-ins/JSON/stringify/value-bigint-replacer.js +built-ins/JSON/stringify/value-bigint-tojson.js +built-ins/JSON/stringify/value-bigint-tojson-receiver.js \ No newline at end of file diff --git a/ts2panda/src/compiler.ts b/ts2panda/src/compiler.ts index 59cd1d776e..fcc8536e36 100644 --- a/ts2panda/src/compiler.ts +++ b/ts2panda/src/compiler.ts @@ -1210,7 +1210,7 @@ export class Compiler { // lvalue var = acc +/- 1 lref.setValue(); // acc = operand_old - pandaGen.toNumber(expr, operandReg); + pandaGen.toNumeric(expr, operandReg); pandaGen.freeTemps(operandReg); } diff --git a/ts2panda/src/pandagen.ts b/ts2panda/src/pandagen.ts index 0db314b6bd..65834994a5 100644 --- a/ts2panda/src/pandagen.ts +++ b/ts2panda/src/pandagen.ts @@ -163,6 +163,7 @@ import { EcmaSub2dyn, EcmaSuspendgenerator, EcmaTonumber, + EcmaTonumeric, EcmaTypeofdyn, EcmaXor2dyn, Imm, @@ -1002,6 +1003,10 @@ export class PandaGen { this.add(node, new EcmaTonumber(arg)); } + toNumeric(node: ts.Node, arg: VReg) { + this.add(node, new EcmaTonumeric(arg)); + } + createGeneratorObj(node: ts.Node, funcObj: VReg) { this.add(node, new EcmaCreategeneratorobj(funcObj)); } -- Gitee