allen at wirfs-brock.com
Fri Mar 18 13:41:09 PDT 2011
On Mar 18, 2011, at 12:33 PM, John-David Dalton wrote:
>> Can you provide some concrete real world examples of setting alternative prototypes on Number, Boolean, and String instances? RegExp too, but that's a different beast. Also I don't believe that oliver's solution helps you much for functions.
> On my initial email I had a `read more` section:
> (the fusebox repo links to screencasts on the topic too)
> You may also be interested in:
I think I understand what you doing here, especially for Array but I don't think it really addresses my Number, Boolean, String question. Instances of those instances usually aren't created via explicit constructor calls but by implicit conversions that the ES5 spec. "hardwires" to the appropriate built-in prototype object. In the most common cases for es5, say "string".concat(foo) a string object isn't even created for the property lookup.
I'm skeptical that many developers actually would code: fs.String("stirng").concat(foo) rather than"string".concat(foo). How much actual usage do you see of the Number, Boolean, and String cases?
More information about the es-discuss