Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

执行JavaScript数组下标出现错误 #7

Open
sornian opened this issue Apr 5, 2019 · 2 comments
Open

执行JavaScript数组下标出现错误 #7

sornian opened this issue Apr 5, 2019 · 2 comments

Comments

@sornian
Copy link

sornian commented Apr 5, 2019

var obj={code:0,msg:"success",data:[{id:1000,name:"jack"},{id:1001,name:"pony"}]};
print(obj.data[0].id);

报错
E/ScriptEngine: ScriptEngine javascript TypeError: cannot read property '__g' of undefined

@sornian
Copy link
Author

sornian commented Apr 5, 2019

如果代码这样写就可以
var obj={code:0,msg:"success",data:[{id:1000,name:"jack"},{id:1001,name:"pony"}]};
var data=obj.data;
print(data[0].id);

@gubaojian
Copy link
Owner

后续我验证一下,看看问题在哪儿

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants