sanyaade-g2g-repos / skulpt

Automatically exported from code.google.com/p/skulpt
Other
0 stars 0 forks source link

toJSON should be __json__ #91

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Please provide any additional information.
toJSON is a very unpythonic method identifier. I think str(3).__json__() is 
much cleaner.

Original issue reported on code.google.com by carnioja...@gmail.com on 31 Mar 2011 at 9:38

GoogleCodeExporter commented 9 years ago
toJSON comes from (I suspect) your browser. It's not added by Skulpt anyway.

It might be worth filtering it out in dir() and similar functions though.

Original comment by sgraham on 31 Mar 2011 at 9:11

GoogleCodeExporter commented 9 years ago

Original comment by sgraham on 3 Apr 2011 at 7:26

GoogleCodeExporter commented 9 years ago
Our issue was that dir() was blindly checking the prototype of the value passed 
to it, which is a problem because skulpt's number types are just native js 
numbers. So I modified it to do some filtering (I think hasOwnProperty and 
treat number types differently).

Original comment by carnioja...@gmail.com on 3 Apr 2011 at 8:39