开发者

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

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜