3 mystructure = { a:39, b:3, addStuff : function(c,d) { return c+d; } };
5 mystring = JSON.stringify(mystructure, undefined);
7 // 42-tiny-js change begin --->
8 // in JavaScript eval is not JSON.parse
9 // use parentheses or JSON.parse instead
10 //mynewstructure = eval(mystring);
11 mynewstructure = eval("("+mystring+")");
12 mynewstructure2 = JSON.parse(mystring);
13 //<--- 42-tiny-js change end
15 result = mynewstructure.addStuff(mynewstructure.a, mynewstructure.b) == 42 && mynewstructure2.addStuff(mynewstructure2.a, mynewstructure2.b) == 42;