mirror of
https://github.com/openharmony/ark_ts2abc.git
synced 2026-07-01 09:24:57 -04:00
fix code and copyright
Signed-off-by: wangjunlin <wangjunlin9@huawei.com> Change-Id: I3afe9c002602fd8b9053476419beaf92e95a8acd
This commit is contained in:
@@ -56,11 +56,11 @@ Note:If the text contains special characters, please escape them according to th
|
||||
<policyitem type="compatibility" name="Apache" path="ark/ts2abc" rule="may" group="defaultGroup" filefilter="defaultPolicyFilter" desc=""/>
|
||||
</policy>
|
||||
<filefilterlist>
|
||||
<filefilter name="binaryFileTypePolicyFilter" desc="二进制文件校验策略的过滤条件" >
|
||||
<filefilter name="binaryFileTypePolicyFilter" desc="" >
|
||||
</filefilter>
|
||||
<filefilter name="copyrightPolicyFilter" desc="copyright文件头校验策略的过滤条件" >
|
||||
<filefilter name="copyrightPolicyFilter" desc="" >
|
||||
</filefilter>
|
||||
<filefilter name="defaultPolicyFilter" desc="根目录LICENSE文件校验策略的过滤条件xxx" >
|
||||
<filefilter name="defaultPolicyFilter" desc="" >
|
||||
</filefilter>
|
||||
</filefilterlist>
|
||||
</oatconfig>
|
||||
|
||||
@@ -1,3 +1,18 @@
|
||||
/*
|
||||
* Copyright (c) 2022 Huawei Device Co., Ltd.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
let a = [1];
|
||||
a[0] = 2;
|
||||
|
||||
|
||||
+20
-19
@@ -240,18 +240,18 @@ export class Compiler {
|
||||
hasAFChild = true;
|
||||
}
|
||||
});
|
||||
|
||||
if (hasAFChild) {
|
||||
this.storeSpecialArg2LexEnv("4newTarget");
|
||||
this.storeSpecialArg2LexEnv("arguments");
|
||||
|
||||
if (ts.isConstructorDeclaration(rootNode) && rootNode.parent.heritageClauses) {
|
||||
this.storeSpecialArg2LexEnv("4funcObj");
|
||||
return;
|
||||
}
|
||||
|
||||
this.storeSpecialArg2LexEnv("this");
|
||||
if (!hasAFChild) {
|
||||
return ;
|
||||
}
|
||||
this.storeSpecialArg2LexEnv("4newTarget");
|
||||
this.storeSpecialArg2LexEnv("arguments");
|
||||
|
||||
if (ts.isConstructorDeclaration(rootNode) && rootNode.parent.heritageClauses) {
|
||||
this.storeSpecialArg2LexEnv("4funcObj");
|
||||
return;
|
||||
}
|
||||
|
||||
this.storeSpecialArg2LexEnv("this");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -300,14 +300,15 @@ export class Compiler {
|
||||
compileReturnThis4Ctor(this, body.parent, unreachableFlag);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!unreachableFlag) { // exit GlobalScopefunction or Function Block return
|
||||
if (this.funcBuilder instanceof AsyncFunctionBuilder) {
|
||||
this.funcBuilder.resolve(NodeKind.Invalid, getVregisterCache(pandaGen, CacheList.undefined));
|
||||
pandaGen.return(NodeKind.Invalid);
|
||||
} else {
|
||||
pandaGen.returnUndefined(NodeKind.Invalid);
|
||||
}
|
||||
if (unreachableFlag) {
|
||||
return ;
|
||||
}
|
||||
// exit GlobalScopefunction or Function Block return
|
||||
if (this.funcBuilder instanceof AsyncFunctionBuilder) {
|
||||
this.funcBuilder.resolve(NodeKind.Invalid, getVregisterCache(pandaGen, CacheList.undefined));
|
||||
pandaGen.return(NodeKind.Invalid);
|
||||
} else {
|
||||
pandaGen.returnUndefined(NodeKind.Invalid);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -91,7 +91,7 @@ describe("RegAllocator", function () {
|
||||
|
||||
it("make spill for CalliDynRange", function () {
|
||||
/* since the bitwidth for CalliDynRange source register is 16 now, we do not need to make spill at all.
|
||||
but later 16 might be changed to 8, then spill operation will be needed in some cases. this testcase is designed
|
||||
but in case later 16 might be changed to 8, then spill operation will be needed in some cases. this testcase is designed
|
||||
for 8bits constraints.
|
||||
*/
|
||||
let string = "";
|
||||
|
||||
@@ -820,10 +820,9 @@ int ParseJson(const std::string &data, Json::Value &rootValue)
|
||||
{
|
||||
JSONCPP_STRING errs;
|
||||
Json::CharReaderBuilder readerBuilder;
|
||||
bool res;
|
||||
|
||||
std::unique_ptr<Json::CharReader> const jsonReader(readerBuilder.newCharReader());
|
||||
res = jsonReader->parse(data.c_str(), data.c_str() + data.length(), &rootValue, &errs);
|
||||
bool res = jsonReader->parse(data.c_str(), data.c_str() + data.length(), &rootValue, &errs);
|
||||
if (!res || !errs.empty()) {
|
||||
std::cerr << "ParseJson err. " << errs.c_str() << std::endl;
|
||||
return RETURN_FAILED;
|
||||
|
||||
Reference in New Issue
Block a user