mirror of
https://gitee.com/openharmony/napi_generator
synced 2024-11-23 08:20:01 +00:00
modified
Signed-off-by: zhangmenghan <zhangmenghan@kaihong.com>
This commit is contained in:
parent
9cbaf73440
commit
90e11e98a5
@ -33,6 +33,8 @@ struct napiwrap {
|
||||
@State testcont: string = ' // 测试 N-API napi_wrap \n'
|
||||
+ ' const result = testNapi.testNapiWrap(); \n'
|
||||
+ ' console.log(result); \n'
|
||||
+ ' const ret = result.Tyof(1024); \n'
|
||||
+ ' console.log(ret);\n'
|
||||
|
||||
|
||||
controller: TextAreaController = new TextAreaController()
|
||||
@ -84,8 +86,9 @@ struct napiwrap {
|
||||
.id('napi_wrap')
|
||||
.onClick(() => {
|
||||
let node: testNapi.testNapiWrap = new testNapi.testNapiWrap();
|
||||
console.log(`Node.Tyof('1024') is ${node.Tyof(1024)}`);
|
||||
let ret = node.Tyof(1024);
|
||||
this.testcont = this.testcont.replace('log(result)', 'log(## type of node is ' + typeof (node) + ' ##)');
|
||||
this.testcont = this.testcont.replace('log(ret)', 'log(## ' + ret + ' ##)');
|
||||
})
|
||||
}
|
||||
.width('100%')
|
||||
|
@ -45,11 +45,11 @@ export default function abilityTestJsObjectWrap() {
|
||||
let ret: testNapi.testNapiWrap = new testNapi.testNapiWrap();
|
||||
hilog.info(0x0000, 'testTag', `type of napi_wrap() is = ${typeof (ret)}`);
|
||||
expect(typeof (ret)).assertEqual('object');
|
||||
|
||||
let ret1 = ret.Tyof('');
|
||||
hilog.info(0x0000, 'testTag', `type of ret.Tyof('') is = ${typeof (ret1)}`);
|
||||
expect(ret1).assertEqual('string');
|
||||
|
||||
|
||||
let ret2 = ret.Tyof(false);
|
||||
hilog.info(0x0000, 'testTag', `type of ret.Tyof(false) is = ${typeof (ret2)}`);
|
||||
expect(ret2).assertEqual('boolean');
|
||||
|
Loading…
Reference in New Issue
Block a user