[Webkit-unassigned] [Bug 18056] Cannot convert DOM exception prototype object to a string

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri Sep 4 06:56:21 PDT 2009


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


Darin Adler <darin at apple.com> changed:

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




--- Comment #10 from Darin Adler <darin at apple.com>  2009-09-04 06:56:20 PDT ---
(From update of attachment 39038)
> +                if ($function->signature->name eq "toString") {
> +                  $implIncludes{"PlatformString.h"} = 1;
> +                  push(@implContent, "    if (thisValue.inherits(&${className}Prototype::s_info))\n");
> +                  push(@implContent, "        return jsNontrivialString(exec, \"[object \" + String(thisValue.toThisObject(exec)->className()) + \"]\");\n");
> +                }

Should be indented four spaces, not two.

If you use String() here you'll get the inefficient WebCore::String, which
reallocates on every append. Then convert into a UString since that's what the
jsNontrivialString function takes.

You'll want to use UString() instead. It may need to be written as
JSC::UString.

> +PASS String(new WebKitCSSMatrix().__proto__) is "[object WebKitCSSMatrixPrototype]"
> +PASS Object.prototype.toString.call(new WebKitCSSMatrix().__proto__) is "[object WebKitCSSMatrixPrototype]"

Doesn't WebKitCSSMatrix.prototype work? If not, is that a bug?

In some cases, I think this is the only way our internal class names are
exposed. I'm not sure that names such as DOMException, DOMWindow, DOMSelection
are suitable to be seen by the web pages. Are those names the same as in other
browsers? 

Otherwise, this looks good.

review- because of the UString issue.

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