!145 删除多余的全局function

Merge pull request !145 from 程顺/dev
This commit is contained in:
openharmony_ci
2023-09-15 10:21:16 +00:00
committed by Gitee
@@ -27,6 +27,9 @@ import { getCallbackStatement, getReturnStatement } from './generateCommonUtil';
* @returns
*/
export function generateExportFunction(functionEntity: FunctionEntity, sourceFile: SourceFile, mockApi: string): string {
if (functionEntity.functionName !== 'getContext') {
return '';
}
let functionBody = '';
functionBody = `global.${functionEntity.functionName} = function (...args) {`;
functionBody += `console.warn('The ${functionEntity.functionName} interface in the Previewer is a mocked implementation and may behave differently than on a real device.');\n`;