【发布时间】:2019-10-23 03:22:19
【问题描述】:
有没有比使用以下 kludge 更简洁的方法来获取 Javascript 对象的 JSON 表示?
System.out.println(((ScriptableObject) scope).callMethod(
cx, (Scriptable) scope.get("JSON", scope),
"stringify", new Object[]{jsObject}));
其中 jsObject 是我要字符串化的 ScriptableObject。
【问题讨论】:
标签: rhino