+2  A: 

toSource is non standard and works in the gecko engine only, so will not work in chrome, safari or IE.

See this SO question and answers.

Oded
A: 

It is not the same as toSource() but json2.js has JSON.stringify() which will convert a JavaScript object to JSON. This won't convert everything that .toSource() will. It doesn't for instance deal with functions.

gnarf