提交 d60873e4 编写于 作者: lizhongyi_'s avatar lizhongyi_

调整UTSJSONObject部分测试例代码

(cherry picked from commit a90c8d0c)
上级 c76d9188
...@@ -203,7 +203,7 @@ export function testUTSJSONObject() : Result { ...@@ -203,7 +203,7 @@ export function testUTSJSONObject() : Result {
}) })
// #END // #END
// #ifdef APP-ANDROID
// #TEST UTSJSONObject.convert // #TEST UTSJSONObject.convert
type User = { type User = {
name : string, name : string,
...@@ -214,13 +214,13 @@ export function testUTSJSONObject() : Result { ...@@ -214,13 +214,13 @@ export function testUTSJSONObject() : Result {
age: 12 age: 12
} }
// UTSJSONObject => 自定义type // UTSJSONObject => 自定义type
let userA = JSON.parse<User>(jsonObj.toJSONString()) let userA = JSON.parse<User>(JSON.stringify(jsonObj)!)
console.log(userA!.name) console.log(userA!.name)
// 自定义type => UTSJSONObject // 自定义type => UTSJSONObject
let utsJsonA = JSON.parseObject(JSON.stringify(userA)) let utsJsonA = JSON.parseObject(JSON.stringify(userA)!)
console.log(utsJsonA) console.log(utsJsonA)
// #END // #END
// #endif
}) })
}) })
} }
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册