[Webkit-unassigned] [Bug 70215] Generate WebKitCSSMatrix constructor for JSC by [Constructor] IDL

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu Oct 27 15:13:39 PDT 2011


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


Gavin Barraclough <barraclough at apple.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |barraclough at apple.com




--- Comment #6 from Gavin Barraclough <barraclough at apple.com>  2011-10-27 15:13:39 PST ---
(In reply to comment #5)
> (From update of attachment 111545 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=111545&action=review
> 
> >> Source/JavaScriptCore/runtime/JSString.h:712
> >> +            return UString();
> > 
> > This is wrong.  The empty value JSValue should be treated like a null pointer, and you should never call functions on it.
> 
> Thanks, sam!
> 
> However, toNumber(), toFloat(), toInt32(), toUInt32() and toInteger() return 0 when an empty value is passed to them. Specifically, in case of the empty value, those methods fallback to JSValue::toNumberSlowCase(), which returns 0. toBoolean() returns false when the empty value is passed. Judging from these behaviors, I guess that it would make sense to return the "default value" of the given type when the empty value is passed. If so, returning UString() from toString() would also make sense. 
> 
> Why do you think that the empty value should be treated like a null pointer?

The empty value is not a valid value to be passed into JavaScript code (it does not have a a meaning within the language), and JS code will not check for this (e.g. passing the empty value to JIT code could lead to a null pointer exception).  The correct interpretation of the empty value is as an in-band signal of an error.  It is not a valid value to operate on or to pass to functions.

I think the numeric conversions should probably not be accepting the empty value, that this is an error.  They should likely be able to ASSERT against this usage.

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