bsed / json-template

Automatically exported from code.google.com/p/json-template
0 stars 0 forks source link

ToString filter not doing what it should. (javascript) #8

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
The ToString formatter should invoke s.toString() which is either
Object.toString() or whatever is overridden. Since javascript does not do
this automatically like java does whenever converting an object to a string
it would make sense to do this, otherwise ToString is really a noop.

Original issue reported on code.google.com by dlikhten on 7 Apr 2009 at 12:22

GoogleCodeExporter commented 9 years ago
Yes, good point.  The 'str' formatter is defined as "an implementation-specific
string representation for the JSON node".

I added you as a member to the project.  Can you provide a patch for review?  
See here:

http://code.google.com/p/json-template/wiki/DevelopingJsonTemplate

Thanks.  This also points to the need for JavaScript-specific tests... 

Original comment by gtempacc...@yahoo.com on 7 Apr 2009 at 2:35

GoogleCodeExporter commented 9 years ago
There are a few other issues I really want to tackle before I just go on to 
patch up
the little problem in the JS impl (and more might become visible as I really go
through all of it). 

However this is a trivial fix :) Sure why not. 

In javascript the standard is the .toString method, though Java casts all 
objects
using the .toString method when converting them to a string, javascript does 
not do
this automatically. But the Object object has it.

Original comment by dlikhten on 7 Apr 2009 at 3:27

GoogleCodeExporter commented 9 years ago
Fixed in r194.

Original comment by gtempacc...@yahoo.com on 17 Apr 2009 at 3:54