diff --git a/es2panda/compiler/core/function.cpp b/es2panda/compiler/core/function.cpp index 8625e3f28155c571f83e1abbde96feac25844436..8e1aafacb71f1223c68fdc77bf0927e2149809f6 100644 --- a/es2panda/compiler/core/function.cpp +++ b/es2panda/compiler/core/function.cpp @@ -81,7 +81,7 @@ static void CompileFunctionParameterDeclaration(PandaGen *pg, const ir::ScriptFu if (ref.Kind() == ReferenceKind::DESTRUCTURING) { auto *loadParamLabel = pg->AllocLabel(); - pg->BranchIfNotUndefined(func, loadParamLabel); + pg->BranchIfStrictNotUndefined(func, loadParamLabel); param->AsAssignmentPattern()->Right()->Compile(pg); pg->Branch(func, nonDefaultLabel); @@ -91,7 +91,7 @@ static void CompileFunctionParameterDeclaration(PandaGen *pg, const ir::ScriptFu pg->SetLabel(func, nonDefaultLabel); ref.SetValue(); } else { - pg->BranchIfNotUndefined(func, nonDefaultLabel); + pg->BranchIfStrictNotUndefined(func, nonDefaultLabel); param->AsAssignmentPattern()->Right()->Compile(pg); ref.SetValue(); @@ -156,9 +156,8 @@ static void CompileFunction(PandaGen *pg) pg->StoreAccToLexEnv(pg->RootNode(), funcParamScope->Find(funcParamScope->NameVar()->Name()), true); } - CompileFunctionParameterDeclaration(pg, decl); - pg->FunctionEnter(); + CompileFunctionParameterDeclaration(pg, decl); const ir::AstNode *body = decl->Body(); if (body->IsExpression()) { diff --git a/es2panda/compiler/core/pandagen.cpp b/es2panda/compiler/core/pandagen.cpp index 7490c15bdee7f815479190dececd0c9a66f61cd9..75acc10f55fb40c6166816a96662a288dd590be9 100644 --- a/es2panda/compiler/core/pandagen.cpp +++ b/es2panda/compiler/core/pandagen.cpp @@ -1142,12 +1142,12 @@ void PandaGen::AsyncFunctionAwait(const ir::AstNode *node, VReg asyncFuncObj, VR void PandaGen::AsyncFunctionResolve(const ir::AstNode *node, VReg asyncFuncObj, VReg value, VReg canSuspend) { - ra_.Emit(node, asyncFuncObj, value, canSuspend); + ra_.Emit(node, asyncFuncObj, canSuspend, value); } void PandaGen::AsyncFunctionReject(const ir::AstNode *node, VReg asyncFuncObj, VReg value, VReg canSuspend) { - ra_.Emit(node, asyncFuncObj, value, canSuspend); + ra_.Emit(node, asyncFuncObj, canSuspend, value); } void PandaGen::AsyncGeneratorResolve(const ir::AstNode *node, VReg asyncGenObj) diff --git a/es2panda/compiler/function/asyncFunctionBuilder.cpp b/es2panda/compiler/function/asyncFunctionBuilder.cpp index 170db3207315506a56f354e901c50a69a9fe9dc7..b89db47075446fa6b0b84cd52f54886f21982407 100644 --- a/es2panda/compiler/function/asyncFunctionBuilder.cpp +++ b/es2panda/compiler/function/asyncFunctionBuilder.cpp @@ -28,10 +28,8 @@ void AsyncFunctionBuilder::DirectReturn(const ir::AstNode *node) const VReg canSuspend = pg_->AllocReg(); pg_->StoreAccumulator(node, retVal); - pg_->LoadConst(node, Constant::JS_TRUE); - pg_->StoreAccumulator(node, canSuspend); + pg_->StoreConst(node, canSuspend, Constant::JS_TRUE); pg_->AsyncFunctionResolve(node, funcObj_, retVal, canSuspend); - pg_->LoadAccumulator(node, retVal); pg_->EmitReturn(node); } diff --git a/es2panda/compiler/function/functionBuilder.cpp b/es2panda/compiler/function/functionBuilder.cpp index 47184ca1f557a1cbed483deb7641eac1ad3da9cb..d2e791308b6f8236906ff455770fdd1085efbc9f 100644 --- a/es2panda/compiler/function/functionBuilder.cpp +++ b/es2panda/compiler/function/functionBuilder.cpp @@ -117,22 +117,25 @@ void FunctionBuilder::Await(const ir::AstNode *node) void FunctionBuilder::HandleCompletion(const ir::AstNode *node, VReg completionType, VReg completionValue) { - // .return(value) - pg_->LoadAccumulatorInt(node, static_cast(ResumeMode::RETURN)); + if (BuilderKind() == BuilderType::GENERATOR) { + // .return(value) + pg_->LoadAccumulatorInt(node, static_cast(ResumeMode::RETURN)); - auto *notRetLabel = pg_->AllocLabel(); - pg_->Condition(node, lexer::TokenType::PUNCTUATOR_EQUAL, completionType, notRetLabel); - if (!handleReturn_) { - handleReturn_ = true; - pg_->ControlFlowChangeBreak(); - handleReturn_ = false; - } + auto *notRetLabel = pg_->AllocLabel(); + pg_->Condition(node, lexer::TokenType::PUNCTUATOR_EQUAL, completionType, notRetLabel); + if (!handleReturn_) { + handleReturn_ = true; + pg_->ControlFlowChangeBreak(); + handleReturn_ = false; + } - pg_->LoadAccumulator(node, completionValue); - pg_->DirectReturn(node); + pg_->LoadAccumulator(node, completionValue); + pg_->DirectReturn(node); + + // .throw(value) + pg_->SetLabel(node, notRetLabel); + } - // .throw(value) - pg_->SetLabel(node, notRetLabel); pg_->LoadAccumulatorInt(node, static_cast(ResumeMode::THROW)); auto *not_throw_label = pg_->AllocLabel(); diff --git a/test262/config.py b/test262/config.py index f2a1d8836ed8243c3ccd41292389f2bcb88a3484..cdaf4bbe7183e7cac4cd2eb8d30e7f396c551fa5 100755 --- a/test262/config.py +++ b/test262/config.py @@ -72,7 +72,10 @@ ESHOST_GIT_URL = "https://gitee.com/Han00000000/eshost.git" HARNESS_GIT_URL = "https://gitee.com/Han00000000/test262-harness.git" SKIP_LIST_FILE = os.path.join("test262", "skip_tests.json") +ES2ABC_SKIP_LIST_FILE = os.path.join("test262", "es2abc_skip_tests.json") +TS2ABC_SKIP_LIST_FILE = os.path.join("test262", "ts2abc_skip_tests.json") INTL_SKIP_LIST_FILE = os.path.join("test262", "intl_skip_tests.json") +SKIP_LIST_FILES = [SKIP_LIST_FILE, INTL_SKIP_LIST_FILE] ALL_SKIP_TESTS = [] INTL_SKIP_TESTS = [] diff --git a/test262/es2015_tests.txt b/test262/es2015_tests.txt index 56b9075a7ca8e38a6ff32d5f28b056f007a6b858..ed9caf6de0ea16e7bee27d78ad4816e8bf936ff4 100644 --- a/test262/es2015_tests.txt +++ b/test262/es2015_tests.txt @@ -6697,3 +6697,219 @@ language/module-code/verify-dfs.js language/module-code/verify-dfs-a_FIXTURE.js language/module-code/verify-dfs-b_FIXTURE.js language/statements/generators/default-proto.js +language/expressions/async-function/await-as-binding-identifier-escaped.js +language/expressions/async-function/await-as-identifier-reference-escaped.js +language/expressions/async-function/await-as-binding-identifier.js +language/expressions/async-function/await-as-identifier-reference.js +language/expressions/async-function/await-as-label-identifier-escaped.js +language/expressions/async-function/await-as-label-identifier.js +language/expressions/async-function/early-errors-expression-NSPL-with-USD.js +language/expressions/async-function/early-errors-expression-binding-identifier-arguments.js +language/expressions/async-function/early-errors-expression-body-contains-super-call.js +language/expressions/async-function/early-errors-expression-binding-identifier-eval.js +language/expressions/async-function/early-errors-expression-body-contains-super-property.js +language/expressions/async-function/early-errors-expression-eval-in-formal-parameters.js +language/expressions/async-function/early-errors-expression-formals-contains-super-call.js +language/expressions/async-function/early-errors-expression-formals-body-duplicate.js +language/expressions/async-function/early-errors-expression-formals-contains-super-property.js +language/expressions/async-function/early-errors-expression-not-simple-assignment-target.js +language/expressions/async-function/escaped-async.js +language/expressions/async-function/expression-returns-promise.js +language/expressions/async-function/name.js +language/expressions/async-function/named-array-destructuring-param-strict-body.js +language/expressions/async-function/named-await-as-binding-identifier-escaped.js +language/expressions/async-function/named-await-as-binding-identifier.js +language/expressions/async-function/named-await-as-identifier-reference-escaped.js +language/expressions/async-function/named-await-as-identifier-reference.js +language/expressions/async-function/named-await-as-label-identifier-escaped.js +language/expressions/async-function/named-await-as-label-identifier.js +language/expressions/async-function/named-dflt-params-abrupt.js +language/expressions/async-function/named-dflt-params-duplicates.js +language/expressions/async-function/named-dflt-params-arg-val-not-undefined.js +language/expressions/async-function/named-dflt-params-arg-val-undefined.js +language/expressions/async-function/named-dflt-params-ref-later.js +language/expressions/async-function/named-dflt-params-ref-self.js +language/expressions/async-function/named-dflt-params-ref-prior.js +language/expressions/async-function/named-dflt-params-rest.js +language/expressions/async-function/named-dflt-params-trailing-comma.js +language/expressions/async-function/named-params-trailing-comma-multiple.js +language/expressions/async-function/named-object-destructuring-param-strict-body.js +language/expressions/async-function/named-params-trailing-comma-single.js +language/expressions/async-function/named-rest-param-strict-body.js +language/expressions/async-function/named-rest-params-trailing-comma-early-error.js +language/expressions/async-function/named-returns-async-arrow-returns-arguments-from-parent-function.js +language/expressions/async-function/named-returns-async-arrow-returns-newtarget.js +language/expressions/async-function/named-returns-async-arrow.js +language/expressions/async-function/named-returns-async-function-returns-newtarget.js +language/expressions/async-function/named-returns-async-function-returns-arguments-from-own-function.js +language/expressions/async-function/named-returns-async-function.js +language/expressions/async-function/named-strict-error-reassign-fn-name-in-body-in-arrow.js +language/expressions/async-function/named-strict-error-reassign-fn-name-in-body-in-eval.js +language/expressions/async-function/named-strict-error-reassign-fn-name-in-body.js +language/expressions/async-function/nameless-array-destructuring-param-strict-body.js +language/expressions/async-function/nameless-dflt-params-abrupt.js +language/expressions/async-function/nameless-dflt-params-arg-val-undefined.js +language/expressions/async-function/nameless-dflt-params-duplicates.js +language/expressions/async-function/nameless-dflt-params-arg-val-not-undefined.js +language/expressions/async-function/nameless-dflt-params-rest.js +language/expressions/async-function/nameless-dflt-params-ref-prior.js +language/expressions/async-function/nameless-dflt-params-ref-later.js +language/expressions/async-function/nameless-dflt-params-ref-self.js +language/expressions/async-function/nameless-dflt-params-trailing-comma.js +language/expressions/async-function/nameless-object-destructuring-param-strict-body.js +language/expressions/async-function/nameless-rest-params-trailing-comma-early-error.js +language/expressions/async-function/nameless-rest-param-strict-body.js +language/expressions/async-function/nameless-params-trailing-comma-multiple.js +language/expressions/async-function/nameless-params-trailing-comma-single.js +language/expressions/async-function/syntax-expression-is-PrimaryExpression.js +language/expressions/async-function/try-reject-finally-reject.js +language/expressions/async-function/try-reject-finally-return.js +language/expressions/async-function/try-reject-finally-throw.js +language/expressions/async-function/try-return-finally-reject.js +language/expressions/async-function/try-return-finally-return.js +language/expressions/async-function/try-throw-finally-reject.js +language/expressions/async-function/try-return-finally-throw.js +language/expressions/async-function/try-throw-finally-return.js +language/expressions/async-function/try-throw-finally-throw.js +language/expressions/async-function/forbidden-ext/b1/async-func-expr-named-forbidden-ext-direct-access-prop-arguments.js +language/expressions/async-function/forbidden-ext/b1/async-func-expr-named-forbidden-ext-direct-access-prop-caller.js +language/expressions/async-function/forbidden-ext/b1/async-func-expr-nameless-forbidden-ext-direct-access-prop-arguments.js +language/expressions/async-function/forbidden-ext/b1/async-func-expr-nameless-forbidden-ext-direct-access-prop-caller.js +language/expressions/async-function/forbidden-ext/b2/async-func-expr-named-forbidden-ext-indirect-access-own-prop-caller-get.js +language/expressions/async-function/forbidden-ext/b2/async-func-expr-named-forbidden-ext-indirect-access-own-prop-caller-value.js +language/expressions/async-function/forbidden-ext/b2/async-func-expr-named-forbidden-ext-indirect-access-prop-caller.js +language/expressions/async-function/forbidden-ext/b2/async-func-expr-nameless-forbidden-ext-indirect-access-own-prop-caller-get.js +language/expressions/async-function/forbidden-ext/b2/async-func-expr-nameless-forbidden-ext-indirect-access-own-prop-caller-value.js +language/expressions/async-function/forbidden-ext/b2/async-func-expr-nameless-forbidden-ext-indirect-access-prop-caller.js +language/statements/async-function/await-as-identifier-reference.js +language/statements/async-function/await-as-identifier-reference-escaped.js +language/statements/async-function/await-as-binding-identifier-escaped.js +language/statements/async-function/await-as-binding-identifier.js +language/statements/async-function/array-destructuring-param-strict-body.js +language/statements/async-function/await-as-label-identifier-escaped.js +language/statements/async-function/await-as-label-identifier.js +language/statements/async-function/dflt-params-arg-val-not-undefined.js +language/statements/async-function/dflt-params-duplicates.js +language/statements/async-function/dflt-params-arg-val-undefined.js +language/statements/async-function/declaration-returns-promise.js +language/statements/async-function/dflt-params-abrupt.js +language/statements/async-function/dflt-params-ref-later.js +language/statements/async-function/dflt-params-ref-prior.js +language/statements/async-function/dflt-params-ref-self.js +language/statements/async-function/early-errors-declaration-arguments-in-formal-parameters.js +language/statements/async-function/dflt-params-rest.js +language/statements/async-function/early-errors-declaration-await-in-formals-default.js +language/statements/async-function/dflt-params-trailing-comma.js +language/statements/async-function/early-errors-declaration-NSPL-with-USD.js +language/statements/async-function/early-errors-declaration-await-in-formals.js +language/statements/async-function/early-errors-declaration-binding-identifier-arguments.js +language/statements/async-function/early-errors-declaration-binding-identifier-eval.js +language/statements/async-function/early-errors-declaration-body-contains-super-property.js +language/statements/async-function/early-errors-declaration-body-contains-super-call.js +language/statements/async-function/early-errors-declaration-duplicate-parameters.js +language/statements/async-function/early-errors-declaration-eval-in-formal-parameters.js +language/statements/async-function/early-errors-declaration-formals-body-duplicate.js +language/statements/async-function/escaped-async.js +language/statements/async-function/early-errors-declaration-formals-contains-super-call.js +language/statements/async-function/early-errors-declaration-formals-contains-super-property.js +language/statements/async-function/evaluation-body-that-returns-after-await.js +language/statements/async-function/evaluation-body-that-returns.js +language/statements/async-function/evaluation-body-that-throws-after-await.js +language/statements/async-function/evaluation-body-that-throws.js +language/statements/async-function/evaluation-body.js +language/statements/async-function/evaluation-this-value-passed.js +language/statements/async-function/evaluation-default-that-throws.js +language/statements/async-function/evaluation-unmapped-arguments.js +language/statements/async-function/let-newline-await-in-async-function.js +language/statements/async-function/object-destructuring-param-strict-body.js +language/statements/async-function/params-trailing-comma-multiple.js +language/statements/async-function/rest-param-strict-body.js +language/statements/async-function/params-trailing-comma-single.js +language/statements/async-function/rest-params-trailing-comma-early-error.js +language/statements/async-function/returns-async-arrow-returns-arguments-from-parent-function.js +language/statements/async-function/returns-async-arrow-returns-newtarget.js +language/statements/async-function/returns-async-function-returns-arguments-from-own-function.js +language/statements/async-function/returns-async-arrow.js +language/statements/async-function/returns-async-function.js +language/statements/async-function/syntax-declaration-line-terminators-allowed.js +language/statements/async-function/returns-async-function-returns-newtarget.js +language/statements/async-function/syntax-declaration-no-line-terminator.js +language/statements/async-function/syntax-declaration.js +language/statements/async-function/try-reject-finally-reject.js +language/statements/async-function/try-reject-finally-return.js +language/statements/async-function/try-return-finally-reject.js +language/statements/async-function/try-reject-finally-throw.js +language/statements/async-function/try-return-finally-return.js +language/statements/async-function/try-return-finally-throw.js +language/statements/async-function/try-throw-finally-reject.js +language/statements/async-function/try-throw-finally-return.js +language/statements/async-function/try-throw-finally-throw.js +language/statements/async-function/forbidden-ext/b1/async-func-decl-forbidden-ext-direct-access-prop-arguments.js +language/statements/async-function/forbidden-ext/b1/async-func-decl-forbidden-ext-direct-access-prop-caller.js +language/statements/async-function/forbidden-ext/b2/async-func-decl-forbidden-ext-indirect-access-own-prop-caller-get.js +language/statements/async-function/forbidden-ext/b2/async-func-decl-forbidden-ext-indirect-access-own-prop-caller-value.js +language/statements/async-function/forbidden-ext/b2/async-func-decl-forbidden-ext-indirect-access-prop-caller.js +language/expressions/async-arrow-function/params-trailing-comma-multiple.js +language/expressions/async-arrow-function/params-trailing-comma-single.js +language/expressions/async-arrow-function/early-errors-arrow-NSPL-with-USD.js +language/expressions/async-arrow-function/early-errors-arrow-formals-body-duplicate.js +language/expressions/async-arrow-function/forbidden-ext/b2/async-arrow-function-forbidden-ext-indirect-access-prop-caller.js +language/expressions/async-arrow-function/forbidden-ext/b2/async-arrow-function-forbidden-ext-indirect-access-own-prop-caller-value.js +language/expressions/async-arrow-function/forbidden-ext/b2/async-arrow-function-forbidden-ext-indirect-access-own-prop-caller-get.js +language/expressions/async-arrow-function/forbidden-ext/b1/async-arrow-function-forbidden-ext-direct-access-prop-caller.js +language/expressions/async-arrow-function/forbidden-ext/b1/async-arrow-function-forbidden-ext-direct-access-prop-arguments.js +language/expressions/async-arrow-function/arrow-returns-promise.js +language/expressions/async-arrow-function/early-errors-arrow-formals-contains-super-property.js +language/expressions/async-arrow-function/dflt-params-ref-self.js +language/expressions/async-arrow-function/early-errors-arrow-body-contains-super-call.js +language/expressions/async-arrow-function/escaped-async.js +language/expressions/async-arrow-function/name.js +language/expressions/async-arrow-function/dflt-params-arg-val-undefined.js +language/expressions/async-arrow-function/await-as-binding-identifier.js +language/expressions/async-arrow-function/dflt-params-arg-val-not-undefined.js +language/expressions/async-arrow-function/try-reject-finally-return.js +language/expressions/async-arrow-function/early-errors-arrow-arguments-in-formal-parameters.js +language/expressions/async-arrow-function/rest-param-strict-body.js +language/expressions/async-arrow-function/rest-params-trailing-comma-early-error.js +language/expressions/async-arrow-function/array-destructuring-param-strict-body.js +language/expressions/async-arrow-function/try-reject-finally-throw.js +language/expressions/async-arrow-function/early-errors-arrow-await-in-formals.js +language/expressions/async-arrow-function/try-throw-finally-throw.js +language/expressions/async-arrow-function/try-return-finally-return.js +language/expressions/async-arrow-function/object-destructuring-param-strict-body.js +language/expressions/async-arrow-function/early-errors-arrow-await-in-formals-default.js +language/expressions/async-arrow-function/early-errors-arrow-eval-in-formal-parameters.js +language/expressions/async-arrow-function/dflt-params-duplicates.js +language/expressions/async-arrow-function/early-errors-arrow-formals-lineterminator.js +language/expressions/async-arrow-function/await-as-identifier-reference-escaped.js +language/expressions/async-arrow-function/await-as-label-identifier.js +language/expressions/async-arrow-function/await-as-label-identifier-escaped.js +language/expressions/async-arrow-function/await-as-binding-identifier-escaped.js +language/expressions/async-arrow-function/async-lineterminator-identifier-throws.js +language/expressions/async-arrow-function/await-as-param-nested-arrow-body-position.js +language/expressions/async-arrow-function/early-errors-arrow-formals-contains-super-call.js +language/expressions/async-arrow-function/dflt-params-trailing-comma.js +language/expressions/async-arrow-function/try-return-finally-reject.js +language/expressions/async-arrow-function/dflt-params-rest.js +language/expressions/async-arrow-function/try-reject-finally-reject.js +language/expressions/async-arrow-function/await-as-param-rest-nested-arrow-parameter-position.js +language/expressions/async-arrow-function/try-throw-finally-reject.js +language/expressions/async-arrow-function/await-as-param-ident-nested-arrow-parameter-position.js +language/expressions/async-arrow-function/early-errors-arrow-duplicate-parameters.js +language/expressions/async-arrow-function/try-throw-finally-return.js +language/expressions/async-arrow-function/dflt-params-ref-prior.js +language/expressions/async-arrow-function/unscopables-with-in-nested-fn.js +language/expressions/async-arrow-function/try-return-finally-throw.js +language/expressions/async-arrow-function/unscopables-with.js +language/expressions/async-arrow-function/escaped-async-line-terminator.js +language/expressions/async-arrow-function/early-errors-arrow-body-contains-super-property.js +language/expressions/async-arrow-function/eval-var-scope-syntax-err.js +language/expressions/async-arrow-function/dflt-params-abrupt.js +language/expressions/async-arrow-function/await-as-identifier-reference.js +language/expressions/async-arrow-function/dflt-params-ref-later.js +language/expressions/async-arrow-function/await-as-param-nested-arrow-parameter-position.js +language/expressions/async-arrow-function/forbidden-ext/b1/async-arrow-function-forbidden-ext-direct-access-prop-arguments.js +language/expressions/async-arrow-function/forbidden-ext/b1/async-arrow-function-forbidden-ext-direct-access-prop-caller.js +language/expressions/async-arrow-function/forbidden-ext/b2/async-arrow-function-forbidden-ext-indirect-access-own-prop-caller-get.js +language/expressions/async-arrow-function/forbidden-ext/b2/async-arrow-function-forbidden-ext-indirect-access-own-prop-caller-value.js +language/expressions/async-arrow-function/forbidden-ext/b2/async-arrow-function-forbidden-ext-indirect-access-prop-caller.js \ No newline at end of file diff --git a/test262/es2abc_skip_tests.json b/test262/es2abc_skip_tests.json new file mode 100644 index 0000000000000000000000000000000000000000..c09a10e6b321a15f77bfa6e55d9cf62a2bbbe31c --- /dev/null +++ b/test262/es2abc_skip_tests.json @@ -0,0 +1,19 @@ +[ + { + "reason": "Async function failed testcases", + "files": [ + "language/expressions/async-arrow-function/dflt-params-ref-later.js", + "language/expressions/async-arrow-function/dflt-params-ref-self.js", + "language/expressions/async-arrow-function/escaped-async-line-terminator.js", + "language/expressions/async-arrow-function/rest-params-trailing-comma-early-error.js", + "language/expressions/async-function/named-dflt-params-ref-later.js", + "language/expressions/async-function/named-dflt-params-ref-self.js", + "language/expressions/async-function/nameless-dflt-params-ref-later.js", + "language/expressions/async-function/nameless-dflt-params-ref-self.js", + "language/statements/async-function/dflt-params-ref-later.js", + "language/statements/async-function/dflt-params-ref-self.js", + "language/statements/async-function/evaluation-this-value-passed.js", + "language/statements/async-function/syntax-declaration-line-terminators-allowed.js" + ] + } +] diff --git a/test262/run_test262.py b/test262/run_test262.py index 8b6aac20d9227b2c079fa44a933167e548cc3a60..5fdf49e23a7fde8110273f28fc82ba6783da2ff8 100755 --- a/test262/run_test262.py +++ b/test262/run_test262.py @@ -142,23 +142,22 @@ def init(args): remove_dir(TEST_INTL_DIR) remove_dir(TEST_ES2021_DIR) remove_dir(TEST_CI_DIR) - get_all_skip_tests(SKIP_LIST_FILE) - get_intl_skip_tests(INTL_SKIP_LIST_FILE) + get_all_skip_tests(args) excuting_npm_install(args) -def get_all_skip_tests(file): - with open(file) as jsonfile: - json_data = json.load(jsonfile) - for key in json_data: - ALL_SKIP_TESTS.extend(key["files"]) - +def get_all_skip_tests(args): + # !!! plz correct the condition when changing the default frontend + if args.ark_frontend and args.ark_frontend == ARK_FRONTEND_LIST[1]: + SKIP_LIST_FILES.append(ES2ABC_SKIP_LIST_FILE) + else: + SKIP_LIST_FILES.append(TS2ABC_SKIP_LIST_FILE) -def get_intl_skip_tests(file): - with open(file) as jsonfile: - json_data = json.load(jsonfile) - for key in json_data: - INTL_SKIP_TESTS.extend(key["files"]) + for file in SKIP_LIST_FILES: + with open(file) as jsonfile: + json_data = json.load(jsonfile) + for key in json_data: + ALL_SKIP_TESTS.extend(key["files"]) def collect_files(path): @@ -277,15 +276,13 @@ class TestPrepare(): else: self.args.dir = os.path.join(DATA_DIR, "test") - def copyfile(self, file, all_skips, intl_skips): + def copyfile(self, file, all_skips): dstdir = os.path.join(DATA_DIR, "test") file = file.strip() file = file.strip('\n') file = file.replace("\\", "/") if file in all_skips: return - if file in intl_skips: - return srcdir = os.path.join(DATA_DIR, "test", file) if self.args.es51: @@ -377,7 +374,7 @@ class TestPrepare(): pool = Pool(DEFAULT_THREADS) for it in files: - pool.apply(self.copyfile, (it, ALL_SKIP_TESTS, INTL_SKIP_TESTS)) + pool.apply(self.copyfile, (it, ALL_SKIP_TESTS)) pool.close() pool.join() diff --git a/test262/ts2abc_skip_tests.json b/test262/ts2abc_skip_tests.json new file mode 100644 index 0000000000000000000000000000000000000000..3023a56b539ae8bb55927aefa6568766c03de3f5 --- /dev/null +++ b/test262/ts2abc_skip_tests.json @@ -0,0 +1,33 @@ +[ + { + "reason": "Async Function failed testcases", + "files": [ + "language/expressions/async-arrow-function/array-destructuring-param-strict-body.js", + "language/expressions/async-arrow-function/await-as-param-rest-nested-arrow-parameter-position.js", + "language/expressions/async-arrow-function/dflt-params-abrupt.js", + "language/expressions/async-arrow-function/await-as-param-nested-arrow-body-position.js", + "language/expressions/async-arrow-function/dflt-params-ref-later.js", + "language/expressions/async-arrow-function/dflt-params-ref-self.js", + "language/expressions/async-arrow-function/object-destructuring-param-strict-body.js", + "language/expressions/async-function/named-array-destructuring-param-strict-body.js", + "language/expressions/async-function/named-dflt-params-abrupt.js", + "language/expressions/async-function/named-dflt-params-ref-later.js", + "language/expressions/async-function/named-dflt-params-ref-self.js", + "language/expressions/async-function/named-object-destructuring-param-strict-body.js", + "language/expressions/async-function/named-strict-error-reassign-fn-name-in-body-in-arrow.js", + "language/expressions/async-function/nameless-dflt-params-abrupt.js", + "language/expressions/async-function/nameless-array-destructuring-param-strict-body.js", + "language/expressions/async-function/nameless-object-destructuring-param-strict-body.js", + "language/expressions/async-function/nameless-dflt-params-ref-later.js", + "language/expressions/async-function/nameless-dflt-params-ref-self.js", + "language/statements/async-function/array-destructuring-param-strict-body.js", + "language/statements/async-function/dflt-params-abrupt.js", + "language/statements/async-function/dflt-params-ref-self.js", + "language/statements/async-function/dflt-params-ref-later.js", + "language/statements/async-function/evaluation-default-that-throws.js", + "language/statements/async-function/evaluation-this-value-passed.js", + "language/statements/async-function/object-destructuring-param-strict-body.js", + "language/statements/async-function/syntax-declaration-line-terminators-allowed.js" + ] + } +]