提交 1c2f0792 编写于 作者: C coollixin

arkts语法整改

Signed-off-by: Ncoollixin <lixin581@huawei.com>
上级 4ebb1c5d
......@@ -139,7 +139,7 @@ struct Index {
.fontWeight(FontWeight.Bold)
.onClick(() => {
hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO);
let ret = entry.nativeCallArkTS((value)=>{return value * 2;});
let ret: number = entry.nativeCallArkTS((value: number)=>{return value * 2;});
hilog.info(0x0000, 'testTag', 'Test NAPI nativeCallArkTS ret = %{public}d', ret);
})
}
......
......@@ -80,8 +80,8 @@ insertFront(element: T): void
```ts
class C1 {
name: string
age: string
name: string = ""
age: string = ""
}
let deque: Deque<string | number | boolean | Array<number> | C1> = new Deque();
deque.insertFront("a");
......
......@@ -254,7 +254,18 @@ dir(dir?: Object): void
**示例:**
```js
let a = { foo: { bar: { baz: true } }};
class bar {
baz: boolean = true;
}
let b: bar = {baz: true}
class foo{
bar: bar = b;
}
let c: foo = {bar: b}
class c1{
foo: foo = c;
}
let a: c1 = {foo: c}
console.dir(a);
// Object: {"foo":{"bar":{"baz":true}}}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册