From f0863bcfb9f4244e6b226577de3f0b1d2e120860 Mon Sep 17 00:00:00 2001 From: hufeng Date: Tue, 8 Mar 2022 19:20:01 +0800 Subject: [PATCH] remove some redundant code Signed-off-by: hufeng Change-Id: I8e866b9bffd5d6734e56dcd686fe0ab25955fa8a --- test262/config.py | 5 ----- testTs/config.py | 4 +--- ts2panda/src/compilerUtils.ts | 2 -- ts2panda/src/recorder.ts | 1 - ts2panda/tests/expression/delete.test.ts | 4 ---- 5 files changed, 1 insertion(+), 15 deletions(-) diff --git a/test262/config.py b/test262/config.py index 3e4872c28ae..e04e869ae8a 100755 --- a/test262/config.py +++ b/test262/config.py @@ -34,11 +34,6 @@ ICUI_DIR = f"{CODE_ROOT}/out/hi3516dv300/clang_x64/global/i18n_standard" LLVM_DIR = f"{CODE_ROOT}/prebuilts/clang/ohos/linux-x86_64/llvm/lib/" ARK_JS_RUNTIME_DIR = f"{CODE_ROOT}/out/hi3516dv300/clang_x64/ark/ark_js_runtime" -# " mode_type": { -# "1": "only default", -# "2": "only strict mode", -# "3": "both default and strict mode" -# } DEFAULT_MODE = 2 TEST_ES5_DIR = os.path.join(DATA_DIR, "test_es51") diff --git a/testTs/config.py b/testTs/config.py index c051991bf01..7a29a4b70f2 100644 --- a/testTs/config.py +++ b/testTs/config.py @@ -34,11 +34,9 @@ IMPORT_FILE_PATH = os.path.join("testTs", "import_tests.json") CUR_FILE_DIR = os.path.dirname(__file__) CODE_ROOT = os.path.abspath(os.path.join(CUR_FILE_DIR, "../../..")) ARK_DIR = f"{CODE_ROOT}/out/hi3516dv300/clang_x64/ark/ark" -# ARK_DIR = f"{CODE_ROOT}/out/ohos-arm-release/clang_x64/obj/ark" WORK_PATH = f'{CODE_ROOT}/ark/ts2abc' DEFAULT_ARK_FRONTEND_TOOL = os.path.join(ARK_DIR, "build", "src", "index.js") -# DEFAULT_ARK_FRONTEND_TOOL = os.path.join(ARK_DIR, "ts2abc", "ts2panda", "build", "src", "index.js") TEST_PATH = os.sep.join([".", "testTs", "test"]) OUT_PATH = os.sep.join([".", "out", "testTs"]) @@ -49,4 +47,4 @@ ABC_EXT = ".abc" IMPORT_TEST = "" with open(IMPORT_FILE_PATH,'r') as f: content = f.read() - IMPORT_TEST = json.loads(content) \ No newline at end of file + IMPORT_TEST = json.loads(content) diff --git a/ts2panda/src/compilerUtils.ts b/ts2panda/src/compilerUtils.ts index 2480032b1d3..42082fb7c2d 100644 --- a/ts2panda/src/compilerUtils.ts +++ b/ts2panda/src/compilerUtils.ts @@ -221,7 +221,6 @@ function emitRestElement(restElement: ts.BindingName | ts.Expression, iterator: ); // get value from iter and store it to arrayObj - // getIterValue(iterRecord, iterValue, pandaGen, restElement); iterator.iteratorValue(iterResult); pandaGen.storeObjProperty(restElement, arrayObj, index); @@ -339,7 +338,6 @@ function compileObjectDestructuring(obj: ts.ObjectBindingOrAssignmentPattern, pa if (ts.isComputedPropertyName(key)) { compiler.compileExpression(key.expression); } else { - // compiler.compileExpression(key); if (ts.isIdentifier(key)) { let keyName = jshelpers.getTextOfIdentifierOrLiteral(key); pandaGen.loadAccumulatorString(key, keyName); diff --git a/ts2panda/src/recorder.ts b/ts2panda/src/recorder.ts index d500a8d297a..61f5689708d 100644 --- a/ts2panda/src/recorder.ts +++ b/ts2panda/src/recorder.ts @@ -260,7 +260,6 @@ export class Recorder { let parent = this.getDeclarationNodeOfId(id); if (parent) { - // console.log(id.getText()); let declKind = astutils.getVarDeclarationKind(parent); // collect declaration information to corresponding scope diff --git a/ts2panda/tests/expression/delete.test.ts b/ts2panda/tests/expression/delete.test.ts index c6f318823b8..9b180f10307 100644 --- a/ts2panda/tests/expression/delete.test.ts +++ b/ts2panda/tests/expression/delete.test.ts @@ -26,7 +26,6 @@ import { LdaDyn, LdaiDyn, LdaStr, - ResultType, StaDyn, VReg } from "../../src/irnodes"; @@ -40,9 +39,6 @@ describe("deleteExpressionTest", function () { let propReg = new VReg(); let expected = [ - // let arr = [1, 2]; - // ... - // delete arr[1]; new EcmaStlettoglobalrecord('arr'), new EcmaTryldglobalbyname('arr'), new StaDyn(objReg), -- Gitee