override of Vector.prototype.toJSON results unexpected
I am having trouble overriding the toJSON function
by default toJSON on a Vector3D returns
{ "x": 0, "w": 0, "z": 0, "y": 0, "lengthSquared": 0, "length": 0 }
this is a bit verbose for me, so I am trying to get this result by overriding the toJSON prototype (did I say that right?)
to get a result that looks like
{ "x": 0, "y": 0, "z": 0 }
my function looks like
flash.geom.Vector3D.prototype.toJSON = function (k:*):*
{
return '{' + ' "x":' + this.x + ', "y":' + this.y + ', "z":' + this.z + '}';
}
but I get back
"{\"x\":0,\"y\":0,\"z\":0}"
I have tried a bunch of different ways to encode the result
' - single quote
\" - escape double quote
I am sure I am missing some important peice, anyone have a clue?
