API8eTS工程的FA模型查看预览器输出日志窗口,日志打印不完全

Signed-off-by: buzhifeng <buzhifeng2@huawei.com>
This commit is contained in:
buzhifeng
2022-10-10 15:26:30 +08:00
parent 5ecf271bc6
commit 08d59bb0f1
4 changed files with 13 additions and 5 deletions
+1 -1
View File
@@ -4,7 +4,7 @@
"description": "generate mock",
"main": "main.js",
"scripts": {
"build": "npm install && tsc && cd dist && node main.js && cd .. && eslint -c .eslintrc --fix ../runtime/**/systemplugin/**/*.js"
"build": "npm install && node ../node_modules/typescript/bin/tsc && cd dist && node main.js && cd .. && eslint -c .eslintrc --fix ../runtime/**/systemplugin/**/*.js"
},
"keywords": [
"mock"
@@ -37,7 +37,11 @@ export function generateCommonFunction(rootName: string, functionArray: Array<Fu
functionBody += getCallbackStatement();
}
if (functionEntity.returnType.returnKind !== SyntaxKind.VoidKeyword) {
functionBody += getReturnStatement(functionEntity.returnType, sourceFile);
if (rootName === 'featureAbility' && functionEntity.returnType.returnKindName === 'Context') {
functionBody += 'return _Context;';
} else {
functionBody += getReturnStatement(functionEntity.returnType, sourceFile);
}
}
} else {
const argSet: Set<string> = new Set<string>();
@@ -36,7 +36,11 @@ export function generateCommonMethodSignature(rootName: string, methodSignatureA
methodSignatureBody += getCallbackStatement();
}
if (methodEntity.returnType.returnKind !== SyntaxKind.VoidKeyword) {
methodSignatureBody += getReturnStatement(methodEntity.returnType, sourceFile);
if (rootName === 'Context' && methodEntity.returnType.returnKindName === 'Context') {
methodSignatureBody += 'return Context;';
} else {
methodSignatureBody += getReturnStatement(methodEntity.returnType, sourceFile);
}
}
} else {
const argSet: Set<string> = new Set<string>();
+2 -2
View File
@@ -7,8 +7,8 @@
"scripts": {
"test:lint": "eslint -c .eslintrc --fix test/**/*.ts",
"test:unit": "mocha --timeout 5000 -r ts-node/register test/lib.ts test/ut/**/*.ts test/ut/*.ts",
"build:mock": "cd ./mock-generate && npm run build && cd ..",
"build": "node build_jsmock_system_plugin.js && node build_strip_native_min.js"
"build:mock": "cd ./mock-generate && npm run build",
"build": "npm run build:mock && node build_jsmock_system_plugin.js && node build_strip_native_min.js"
},
"keywords": [
"javascript",