[haXe] double double quotes

Tommy Olesen hojfeld at gmail.com
Fri Nov 3 18:00:04 CET 2006


If something is good, then double as much is double as good.  Everyone
knows this ;-)

But:

        var cnx = swhx.Connection;
        cnx.O.f.call(["\"\""])

throws

        Failed to call Neko method ...

while cnx.O.f.call(["\""]) works fine.

I believe the exception is from this code in swhx/Connection.hx:

        	override public function call( params : Array<Dynamic> ) : Dynamic {
	#if flash
		var p = __path.copy();
		var f = p.pop();
		var path = p.join(".");
		var s = new haxe.Serializer();
		s.serialize(params);
		var params = haxe.remoting.Connection.escapeString(s.toString());
		var s = flash.external.ExternalInterface.call(path+"."+f,params);
		if( s == null )
			throw "Failed to call Neko method "+__path.join(".");

It seems the serializer & escapeString() do not escape double quotes.
(params above is 'as2:""h').  flash.external.ExternalInterface.call()
works for single double quotes, but not for double double quotes.  Maybe
the serializer &/or escapeString() should encode double quotes (or at
least encode double double quotes :-)

So quotes are good (yes we like them), and double quotes even more so.
But double double quotes make you cry.  Only doubling up to double
double double quotes will stop the tears.

And in the end, a single quote:

    Moderation is a fatal thing. Nothing succeeds like excess.
		    			 - Oscar Wilde.


Kind Regards,
Tommy



More information about the Haxe mailing list