Bug 159899 - Make builtin TypeErrors consistent
Summary: Make builtin TypeErrors consistent
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Joseph Pecoraro
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-07-18 14:00 PDT by Joseph Pecoraro
Modified: 2016-07-25 23:39 PDT (History)
10 users (show)

See Also:


Attachments
[PATCH] Proposed Fix (43.53 KB, patch)
2016-07-18 14:03 PDT, Joseph Pecoraro
keith_miller: review+
buildbot: commit-queue-
Details | Formatted Diff | Diff
Archive of layout-test-results from ews102 for mac-yosemite (881.46 KB, application/zip)
2016-07-18 15:00 PDT, Build Bot
no flags Details
Archive of layout-test-results from ews117 for mac-yosemite (1.45 MB, application/zip)
2016-07-18 15:01 PDT, Build Bot
no flags Details
Archive of layout-test-results from ews106 for mac-yosemite-wk2 (1.13 MB, application/zip)
2016-07-18 15:02 PDT, Build Bot
no flags Details
Archive of layout-test-results from ews122 for ios-simulator-wk2 (708.96 KB, application/zip)
2016-07-18 15:05 PDT, Build Bot
no flags Details
[PATCH] For Landing (47.21 KB, patch)
2016-07-18 16:36 PDT, Joseph Pecoraro
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Joseph Pecoraro 2016-07-18 14:00:46 PDT
Summary:
Make builtin TypeErrors for |this| more consistent.

There have been multiple ways to report errors for non-coeracble this objects.

Approach 1:

>    if (this == null) {
>        if (this === null)
>            throw new @TypeError("X requires that |this| not be null");
>        throw new @TypeError("X requires that |this| not be undefined");
>    }

Approach 2:

>    if (this === null)
>        throw new @TypeError("X requires that |this| not be null");
>
>    if (this === @undefined)
>        throw new @TypeError("X requires that |this| not be undefined");

Approach 3:

>    if (this == null)
>        throw new @TypeError("X requires that |this| not be null or undefined");

Of these approaches, the last is the simplest, the smallest (half the byte code size), and provides the most useful information (lists all the values |this| cannot be). Lets converge on this approach.
Comment 1 Joseph Pecoraro 2016-07-18 14:03:17 PDT
Created attachment 283930 [details]
[PATCH] Proposed Fix
Comment 2 Keith Miller 2016-07-18 14:13:18 PDT
Comment on attachment 283930 [details]
[PATCH] Proposed Fix

r=me.
Comment 3 Joseph Pecoraro 2016-07-18 14:17:18 PDT
Comment on attachment 283930 [details]
[PATCH] Proposed Fix

Let me wait on cq+ until the bots run through it.
Comment 4 Build Bot 2016-07-18 15:00:21 PDT
Comment on attachment 283930 [details]
[PATCH] Proposed Fix

Attachment 283930 [details] did not pass mac-ews (mac):
Output: http://webkit-queues.webkit.org/results/1703425

New failing tests:
sputnik/Conformance/15_Native_Objects/15.5_String/15.5.4/15.5.4.12_String.prototype.search/S15.5.4.12_A1_T3.html
sputnik/Conformance/15_Native_Objects/15.5_String/15.5.4/15.5.4.14_String.prototype.split/S15.5.4.14_A1_T3.html
sputnik/Conformance/15_Native_Objects/15.5_String/15.5.4/15.5.4.11_String.prototype.replace/S15.5.4.11_A1_T3.html
sputnik/Conformance/15_Native_Objects/15.5_String/15.5.4/15.5.4.10_String.prototype.match/S15.5.4.10_A1_T3.html
Comment 5 Build Bot 2016-07-18 15:00:24 PDT
Created attachment 283938 [details]
Archive of layout-test-results from ews102 for mac-yosemite

The attached test failures were seen while running run-webkit-tests on the mac-ews.
Bot: ews102  Port: mac-yosemite  Platform: Mac OS X 10.10.5
Comment 6 Build Bot 2016-07-18 15:01:38 PDT
Comment on attachment 283930 [details]
[PATCH] Proposed Fix

Attachment 283930 [details] did not pass mac-debug-ews (mac):
Output: http://webkit-queues.webkit.org/results/1703408

New failing tests:
sputnik/Conformance/15_Native_Objects/15.5_String/15.5.4/15.5.4.12_String.prototype.search/S15.5.4.12_A1_T3.html
sputnik/Conformance/15_Native_Objects/15.5_String/15.5.4/15.5.4.14_String.prototype.split/S15.5.4.14_A1_T3.html
sputnik/Conformance/15_Native_Objects/15.5_String/15.5.4/15.5.4.11_String.prototype.replace/S15.5.4.11_A1_T3.html
sputnik/Conformance/15_Native_Objects/15.5_String/15.5.4/15.5.4.10_String.prototype.match/S15.5.4.10_A1_T3.html
Comment 7 Build Bot 2016-07-18 15:01:42 PDT
Created attachment 283939 [details]
Archive of layout-test-results from ews117 for mac-yosemite

The attached test failures were seen while running run-webkit-tests on the mac-debug-ews.
Bot: ews117  Port: mac-yosemite  Platform: Mac OS X 10.10.5
Comment 8 Build Bot 2016-07-18 15:02:18 PDT
Comment on attachment 283930 [details]
[PATCH] Proposed Fix

Attachment 283930 [details] did not pass mac-wk2-ews (mac-wk2):
Output: http://webkit-queues.webkit.org/results/1703421

New failing tests:
sputnik/Conformance/15_Native_Objects/15.5_String/15.5.4/15.5.4.12_String.prototype.search/S15.5.4.12_A1_T3.html
sputnik/Conformance/15_Native_Objects/15.5_String/15.5.4/15.5.4.14_String.prototype.split/S15.5.4.14_A1_T3.html
sputnik/Conformance/15_Native_Objects/15.5_String/15.5.4/15.5.4.11_String.prototype.replace/S15.5.4.11_A1_T3.html
sputnik/Conformance/15_Native_Objects/15.5_String/15.5.4/15.5.4.10_String.prototype.match/S15.5.4.10_A1_T3.html
Comment 9 Build Bot 2016-07-18 15:02:21 PDT
Created attachment 283940 [details]
Archive of layout-test-results from ews106 for mac-yosemite-wk2

The attached test failures were seen while running run-webkit-tests on the mac-wk2-ews.
Bot: ews106  Port: mac-yosemite-wk2  Platform: Mac OS X 10.10.5
Comment 10 Build Bot 2016-07-18 15:04:57 PDT
Comment on attachment 283930 [details]
[PATCH] Proposed Fix

Attachment 283930 [details] did not pass ios-sim-ews (ios-simulator-wk2):
Output: http://webkit-queues.webkit.org/results/1703381

New failing tests:
sputnik/Conformance/15_Native_Objects/15.5_String/15.5.4/15.5.4.12_String.prototype.search/S15.5.4.12_A1_T3.html
sputnik/Conformance/15_Native_Objects/15.5_String/15.5.4/15.5.4.14_String.prototype.split/S15.5.4.14_A1_T3.html
sputnik/Conformance/15_Native_Objects/15.5_String/15.5.4/15.5.4.11_String.prototype.replace/S15.5.4.11_A1_T3.html
sputnik/Conformance/15_Native_Objects/15.5_String/15.5.4/15.5.4.10_String.prototype.match/S15.5.4.10_A1_T3.html
Comment 11 Build Bot 2016-07-18 15:05:00 PDT
Created attachment 283941 [details]
Archive of layout-test-results from ews122 for ios-simulator-wk2

The attached test failures were seen while running run-webkit-tests on the ios-sim-ews.
Bot: ews122  Port: ios-simulator-wk2  Platform: Mac OS X 10.11.5
Comment 12 Joseph Pecoraro 2016-07-18 16:36:20 PDT
Created attachment 283959 [details]
[PATCH] For Landing

Rebaseline those results.
Comment 13 WebKit Commit Bot 2016-07-18 19:46:31 PDT
Comment on attachment 283959 [details]
[PATCH] For Landing

Clearing flags on attachment: 283959

Committed r203393: <http://trac.webkit.org/changeset/203393>