[Fling] Updated TypeResolver
John Grden
neoriley at gmail.com
Mon May 22 14:29:39 EDT 2006
sure thing!
On 5/22/06, Chris Allen <mrchrisallen at gmail.com> wrote:
>
> var s1:String = "foo";
> var s2:String = "bar";
>
> trace( s1.__proto__ == String.prototype );
> trace( s2.__proto__ == String.prototype );
>
> That should have been:
>
> var s1:String = new String("foo"); //notice this line
> var s2:String = "bar";
>
> trace( s1.__proto__ == String.prototype );
> trace( s2.__proto__ == String.prototype );
>
>
> I do like the idea of using __proto throughout for this though.
>
> This is a lot easier to read:
> var isAString:Boolean = obj.__proto__ == String.prototype ? true : false;
>
> than this:
> var isAString:Boolean = ((typeof(obj) == "string") || obj instanceof
> String) ? true : false;
>
> Thanks for the suggestion Sam.
>
> John can you hook Sam up with commit rights to Fling's SVN?
>
> -Chris
>
--
John Grden - Blitz
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://osflash.org/pipermail/fling_osflash.org/attachments/20060522/5100bb65/attachment-0001.htm
More information about the Fling
mailing list