[Webkit-unassigned] [Bug 81588] Array.prototype.toString should be generic

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri Mar 30 11:09:35 PDT 2012


https://bugs.webkit.org/show_bug.cgi?id=81588


Erik Arvidsson <arv at chromium.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
 Attachment #134723|review?                     |review-
               Flag|                            |




--- Comment #2 from Erik Arvidsson <arv at chromium.org>  2012-03-30 11:09:33 PST ---
(From update of attachment 134723)
View in context: https://bugs.webkit.org/attachment.cgi?id=134723&action=review

Please add tests that ensures the correct behavior.

var obj = {__proto__: Array.prototype, 0: 'a', 1: 'b', 2: 'c', length: 3}
shouldBeEqualToString('obj.toString()', 'a,b,c');

var join = {join: function() { return 'join' }}
shouldBeEqualToString('Array.prototype.toString.call(join)', 'join')

shouldBeEqualToString('Array.prototype.toString.call(new Date)', '[object Date]')

> Source/JavaScriptCore/runtime/ArrayPrototype.cpp:260
> +            JSValue value = thisValue.asCell()->toPrimitive(exec, PreferString);

This does not look correct. How does this check for "join" etc?

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list