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

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Sun Apr 1 20:24:59 PDT 2012


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





--- Comment #3 from hojong.han at samsung.com  2012-04-01 20:24:59 PST ---
(In reply to comment #2)
> (From update of attachment 134723 [details])
> 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?

Could you explain how Array.prototype.toString.call(join) results join , not [object Object]?
(and also Array.prototype.toString.call(new Date) results [object Date], not current date information like Mon Apr 02 2012 12:24:05 GMT+0900 (KST))

-- 
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