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.
>
> Yes.
> On my initial email I had a `read more` section:
> https://mail.mozilla.org/pipermail/es-discuss/2011-March/013131.html
> (the fusebox repo links to screencasts on the topic too)
>
> You may also be interested in:
> http://www.ibm.com/developerworks/web/library/wa-javascripthistory/
> https://github.com/jdalton/fusejs/blob/master/src/lang/string.js
> https://github.com/jdalton/fusejs/blob/master/src/lang/number.js
> https://github.com/jdalton/fusejs/blob/master/src/lang/object.js
> https://github.com/jdalton/fusejs/blob/master/src/lang/regexp.js
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?
Allen
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss