[Webkit-unassigned] [Bug 10782] New: Classes should not override JSObject::toString(ExecState *)

bugzilla-daemon at opendarwin.org bugzilla-daemon at opendarwin.org
Fri Sep 8 04:59:43 PDT 2006


http://bugzilla.opendarwin.org/show_bug.cgi?id=10782

           Summary: Classes should not override JSObject::toString(ExecState
                    *)
           Product: WebKit
           Version: 420+ (nightly)
          Platform: Macintosh
        OS/Version: Mac OS X 10.4
            Status: NEW
          Severity: normal
          Priority: P2
         Component: WebCore JavaScript
        AssignedTo: webkit-unassigned at opendarwin.org
        ReportedBy: opendarwin.org at mitzpettel.com
                CC: ggaren at apple.com


JSObject::toString(ExecState *) implements the (internal) ToString type
conversion operator defined in ECMA-262 9.8. That definition applies to all
objects, so classes deriving from JSObject should not -- and have no reason to
-- override toString.

The correct way to customize the string representation of host objects is to
implement in their prototype either a toString() method or the
[[DefaultValue]]() internal method. (The native [[DefaultValue]] uses toString,
but Firefox compatibility will probably require overriding [[DefaultValue]] as
well).


-- 
Configure bugmail: http://bugzilla.opendarwin.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.



More information about the webkit-unassigned mailing list