有没有更简洁的方法来获取Javascript对象的JSON表示而不是以下kludge?
System.out.println(((ScriptableObject) scope).callMethod(
cx, (Scriptable) scope.get("JSON", scope),
"stringify", new Object[]{jsObject}));
Run Code Online (Sandbox Code Playgroud)
其中jsObject是我想要字符串化的ScriptableObject.
rhino ×1