From c0e7018e580b111ebc2c08fac304bd47c466ddc9 Mon Sep 17 00:00:00 2001 From: oh_ci Date: Sat, 14 Jun 2025 14:02:23 +0000 Subject: [PATCH] =?UTF-8?q?=E5=9B=9E=E9=80=80=20'Pull=20Request=20!4891=20?= =?UTF-8?q?:=20fix=20$r=20$rawfile=20``'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- compiler/src/process_ui_syntax.ts | 2 +- .../resource/resourceTest.js.sample | 58 ------------------- .../resource/resourceTest.ets | 25 -------- .../test/transform_ut/helpers/pathConfig.ts | 2 - 4 files changed, 1 insertion(+), 86 deletions(-) delete mode 100644 compiler/test/transform_ut/application/entry/build/default/cache/default/default@CompileArkTS/esmodule/debug/entry/src/main/ets/pages/utForPartialUpdate/resource/resourceTest.js.sample delete mode 100644 compiler/test/transform_ut/application/entry/src/main/ets/pages/utForPartialUpdate/resource/resourceTest.ets diff --git a/compiler/src/process_ui_syntax.ts b/compiler/src/process_ui_syntax.ts index cada4b755..745b53a78 100644 --- a/compiler/src/process_ui_syntax.ts +++ b/compiler/src/process_ui_syntax.ts @@ -736,7 +736,7 @@ export function isAnimateToOrImmediately(node: ts.Node): boolean { export function processResourceData(node: ts.CallExpression, filePath: string, previewLog: {isAcceleratePreview: boolean, log: LogInfo[]} = {isAcceleratePreview: false, log: []}): ts.Node { - if (ts.isStringLiteral(node.arguments[0]) || ts.isNoSubstitutionTemplateLiteral(node.arguments[0])) { + if (ts.isStringLiteral(node.arguments[0])) { const resourceData: string[] = (node.arguments[0] as ts.StringLiteral).text.trim().split('.'); const isResourceModule: boolean = resourceData.length && /^\[.*\]$/g.test(resourceData[0]); if (node.expression.getText() === RESOURCE_RAWFILE) { diff --git a/compiler/test/transform_ut/application/entry/build/default/cache/default/default@CompileArkTS/esmodule/debug/entry/src/main/ets/pages/utForPartialUpdate/resource/resourceTest.js.sample b/compiler/test/transform_ut/application/entry/build/default/cache/default/default@CompileArkTS/esmodule/debug/entry/src/main/ets/pages/utForPartialUpdate/resource/resourceTest.js.sample deleted file mode 100644 index f3d898bf4..000000000 --- a/compiler/test/transform_ut/application/entry/build/default/cache/default/default@CompileArkTS/esmodule/debug/entry/src/main/ets/pages/utForPartialUpdate/resource/resourceTest.js.sample +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Copyright (c) 2022-2024 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. - */ -"use strict"; -if (!("finalizeConstruction" in ViewPU.prototype)) { - Reflect.set(ViewPU.prototype, "finalizeConstruction", () => { }); -} -class Index extends ViewPU { - constructor(parent, params, __localStorage, elmtId = -1, paramsLambda = undefined, extraInfo) { - super(parent, __localStorage, elmtId, extraInfo); - if (typeof paramsLambda === "function") { - this.paramsGenerator_ = paramsLambda; - } - this.setInitiallyProvidedValue(params); - this.finalizeConstruction(); - } - setInitiallyProvidedValue(params) { - } - updateStateVars(params) { - } - purgeVariableDependenciesOnElmtId(rmElmtId) { - } - aboutToBeDeleted() { - SubscriberManager.Get().delete(this.id__()); - this.aboutToBeDeletedInternal(); - } - initialRender() { - this.observeComponentCreation2((elmtId, isInitialRender) => { - Row.create(); - }, Row); - this.observeComponentCreation2((elmtId, isInitialRender) => { - Image.create({ "id": 0, "type": 30000, params: ['foreground.png'], "bundleName": "com.example.application", "moduleName": "application" }); - }, Image); - this.observeComponentCreation2((elmtId, isInitialRender) => { - Image.create({ "id": 0, "type": 30000, params: [`foreground.png`], "bundleName": "com.example.application", "moduleName": "application" }); - }, Image); - Row.pop(); - } - rerender() { - this.updateDirtyElements(); - } - static getEntryName() { - return "Index"; - } -} -registerNamedRoute(() => new Index(undefined, {}), "", { bundleName: "com.example.application", moduleName: "application", pagePath: "pages/utForPartialUpdate/resource/resourceTest", pageFullPath: "application/entry/src/main/ets/pages/utForPartialUpdate/resource/resourceTest", integratedHsp: "false", moduleType: "followWithHap" }); -//# sourceMappingURL=resourceTest.js.map \ No newline at end of file diff --git a/compiler/test/transform_ut/application/entry/src/main/ets/pages/utForPartialUpdate/resource/resourceTest.ets b/compiler/test/transform_ut/application/entry/src/main/ets/pages/utForPartialUpdate/resource/resourceTest.ets deleted file mode 100644 index 57402fbdb..000000000 --- a/compiler/test/transform_ut/application/entry/src/main/ets/pages/utForPartialUpdate/resource/resourceTest.ets +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (c) 2022-2024 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. - */ -// Reusable test -@Entry -@Component -struct Index { - build() { - Row() { - Image($rawfile('foreground.png')) - Image($rawfile(`foreground.png`)) - } - } -} \ No newline at end of file diff --git a/compiler/test/transform_ut/helpers/pathConfig.ts b/compiler/test/transform_ut/helpers/pathConfig.ts index 14a3de177..936ccfdc3 100644 --- a/compiler/test/transform_ut/helpers/pathConfig.ts +++ b/compiler/test/transform_ut/helpers/pathConfig.ts @@ -213,8 +213,6 @@ export const UT_PARTIAL_UPFATE_PAGES: string[] = [ 'v2_component_decorator/reusableV2/reusableV2_initialRender', 'v2_component_decorator/reusableV2/reusableV2_members', 'v2_component_decorator/reusableV2/reusableV2_component_nesting', - - 'resource/resourceTest', ]; export const UT_VALIDATE_PAGES_PREVIEW: string[] = []; -- Gitee