mirror of
https://github.com/openharmony/developtools_ace-ets2bundle.git
synced 2026-07-21 12:05:24 -04:00
fix enum transfer error Signed-off-by: houhaoyu <houhaoyu@huawei.com> Change-Id: Icc9d56bc91a72b7da56d709597091fefd8a8eb51
This commit is contained in:
+4
-1
@@ -311,9 +311,12 @@ function processResourceArr(resourceArr, resourceMap, filePath) {
|
||||
}
|
||||
}
|
||||
|
||||
const globalProgram = { program: null };
|
||||
|
||||
exports.globalProgram = globalProgram;
|
||||
exports.projectConfig = projectConfig;
|
||||
exports.loadEntryObj = loadEntryObj;
|
||||
exports.readAppResource = readAppResource;
|
||||
exports.resources = resources;
|
||||
exports.loadWorker = loadWorker;
|
||||
exports.abilityConfig = abilityConfig;
|
||||
exports.abilityConfig = abilityConfig;
|
||||
|
||||
@@ -41,6 +41,7 @@ import {
|
||||
extendCollection,
|
||||
importModuleCollection
|
||||
} from './ets_checker';
|
||||
import { globalProgram } from '../main';
|
||||
|
||||
configure({
|
||||
appenders: { 'ETS': {type: 'stderr', layout: {type: 'messagePassThrough'}}},
|
||||
@@ -137,13 +138,17 @@ export class ResultStates {
|
||||
});
|
||||
});
|
||||
|
||||
compiler.hooks.run.tapPromise('CheckSyntax', async(compiler) => {
|
||||
compiler.hooks.beforeRun.tap('beforeRun', () => {
|
||||
const rootFileNames: string[] = [];
|
||||
Object.values(projectConfig.entryObj).forEach((fileName: string) => {
|
||||
rootFileNames.push(fileName.replace('?entry', ''));
|
||||
});
|
||||
const languageService: ts.LanguageService = createLanguageService(rootFileNames);
|
||||
const rootProgram: ts.Program = languageService.getProgram();
|
||||
globalProgram.program = languageService.getProgram();
|
||||
});
|
||||
|
||||
compiler.hooks.run.tapPromise('CheckSyntax', async(compiler) => {
|
||||
const rootProgram: ts.Program = globalProgram.program;
|
||||
props.push(...dollarCollection, ...decoratorParamsCollection, ...extendCollection);
|
||||
let allDiagnostics: ts.Diagnostic[] = rootProgram
|
||||
.getSyntacticDiagnostics()
|
||||
|
||||
@@ -73,6 +73,7 @@ import {
|
||||
createReference,
|
||||
isProperty
|
||||
} from './process_component_class';
|
||||
import { globalProgram } from '../main';
|
||||
|
||||
export type ControllerType = {
|
||||
hasController: boolean
|
||||
@@ -686,7 +687,9 @@ function isForbiddenUseStateType(typeNode: ts.TypeNode): boolean {
|
||||
|
||||
export function isSimpleType(typeNode: ts.TypeNode, program: ts.Program): boolean {
|
||||
let checker: ts.TypeChecker;
|
||||
if (program) {
|
||||
if (globalProgram.program) {
|
||||
checker = globalProgram.program.getTypeChecker();
|
||||
} else if (program) {
|
||||
checker = program.getTypeChecker();
|
||||
}
|
||||
const enumType: ts.SyntaxKind = getEnumType(typeNode, checker);
|
||||
|
||||
Reference in New Issue
Block a user