JSON serialization in Spidermonkey

后端 未结 1 1966
难免孤独
难免孤独 2021-01-06 09:58

I\'m using python-spidermonkey to run JavaScript code.

In order to pass objects (instead of just strings) to Python, I\'m thinking of returning a JSON s

相关标签:
1条回答
  • 2021-01-06 10:11

    I would use JSON.stringify. It's part of the ECMAScript 5 standard, and it's implemented in the current version of spidermonkey. I don't know if it's in the version used by python-spidermonkey, but if it isn't, you can get a JavaScript implementation from http://www.json.org/js.html.

    0 讨论(0)
提交回复
热议问题