开发者

Quick Look at Objects in Rhino Shell (PHP var_dump equivalent?)

开发者 https://www.devze.com 2022-12-29 19:53 出处:网络
Is there a better way of debugging in Rhino than typing this everytime? : for (p开发者_开发问答rop in obj) { print(\"obj[\" + prop + \"] = \" + obj[prop]); };

Is there a better way of debugging in Rhino than typing this everytime? :

for (p开发者_开发问答rop in obj) { print("obj[" + prop + "] = " + obj[prop]); };

Update: To be clear, my question is whether there are any existing standard practices/modules/tricks on this topic.


obj.toSource() will do for basic inspection.


For

obj.toSource() 

there seems to be a strange case where it does not show, ex:

var v = [];
v['love'] = 'amore';    
print(v.toSource());

while your original code (you can wrap it int a dump() works.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号