[webkit-reviews] review canceled: [Bug 216115] new URL("#") should throw an error : [Attachment 408257] Patch

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Sep 8 13:04:08 PDT 2020


Alex Christensen <achristensen at apple.com> has canceled Alex Christensen
<achristensen at apple.com>'s request for review:
Bug 216115: new URL("#") should throw an error
https://bugs.webkit.org/show_bug.cgi?id=216115

Attachment 408257: Patch

https://bugs.webkit.org/attachment.cgi?id=408257&action=review




--- Comment #9 from Alex Christensen <achristensen at apple.com> ---
Comment on attachment 408257
  --> https://bugs.webkit.org/attachment.cgi?id=408257
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=408257&action=review

>> Source/WebCore/html/DOMURL.cpp:-51
>> -	    return Exception { TypeError };
> 
> Wouldn’t a better fix be to add a special case to allow null here.

This is called from DOMURL::create(const String&, const DOMURL&) where we know
the base is non-null and valid.  That would be an unneeded check.  It would
probably be close to equivalent and the difference would probably be
undetectable from JS, but I like the logic like this better.

>> Source/WebCore/html/DOMURL.cpp:-60
>> -	return create(url, base.isNull() ? aboutBlankURL() : URL { URL { },
base });
> 
> And remove the special case for null here?

We need a check for null here because it is ok to not specify the base, in
which case baseURL would be null which should not throw a type error.


More information about the webkit-reviews mailing list