Bug 199138 - Object.prototype.toString is not spec-perfect
Summary: Object.prototype.toString is not spec-perfect
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: WebKit Nightly Build
Hardware: All All
: P2 Minor
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-06-23 15:37 PDT by Alexey Shvayka
Modified: 2019-08-14 13:48 PDT (History)
11 users (show)

See Also:


Attachments
Patch (36.85 KB, patch)
2019-06-23 16:37 PDT, Alexey Shvayka
no flags Details | Formatted Diff | Diff
Archive of layout-test-results from ews102 for mac-highsierra (3.23 MB, application/zip)
2019-06-23 18:01 PDT, Build Bot
no flags Details
Archive of layout-test-results from ews105 for mac-highsierra-wk2 (2.80 MB, application/zip)
2019-06-23 18:09 PDT, Build Bot
no flags Details
Archive of layout-test-results from ews117 for mac-highsierra (3.04 MB, application/zip)
2019-06-23 18:38 PDT, Build Bot
no flags Details
Archive of layout-test-results from ews123 for ios-simulator-wk2 (2.65 MB, application/zip)
2019-06-23 18:47 PDT, Build Bot
no flags Details
Patch (45.59 KB, patch)
2019-06-24 05:53 PDT, Alexey Shvayka
no flags Details | Formatted Diff | Diff
Patch (122.64 KB, patch)
2019-06-24 10:47 PDT, Alexey Shvayka
no flags Details | Formatted Diff | Diff
Patch (123.40 KB, patch)
2019-07-18 11:43 PDT, Alexey Shvayka
no flags Details | Formatted Diff | Diff
Patch (123.40 KB, patch)
2019-07-18 13:18 PDT, Alexey Shvayka
shvaikalesh: review?
shvaikalesh: commit-queue?
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Alexey Shvayka 2019-06-23 15:37:58 PDT
ECMA262: https://tc39.es/ecma262/#sec-object.prototype.tostring
Test262: https://test262.report/browse/built-ins/Object/prototype/toString/proxy-function.js

1. Proxied functions:

```
toString.call(new Proxy(function() {}, {}))
// actual: "[object Object]"
// expected: "[object Function]"
```

2. Proxy constructor:

```
toString.call(Proxy)
// actual: "[object Proxy]"
// expected: "[object Function]"
```

3. Post ES5 built-ins and DOM objects with deleted @@toStringTag are treated specially:

Test262: https://github.com/tc39/test262/pull/2202

```
delete Math[Symbol.toStringTag]
toString.call(Math)
// actual: "[object Math]"
// expected: "[object Object]"
```

4. @@toStringTag symbols are missing on WebAssembly API and DOM objects:

```
document[Symbol.toStringTag]
// actual: undefined
// expected: "HTMLDocument"
```
Comment 1 Alexey Shvayka 2019-06-23 16:37:33 PDT
Created attachment 372719 [details]
Patch
Comment 2 Build Bot 2019-06-23 18:01:34 PDT
Comment on attachment 372719 [details]
Patch

Attachment 372719 [details] did not pass mac-ews (mac):
Output: https://webkit-queues.webkit.org/results/12557900

New failing tests:
inspector/model/remote-object-get-properties.html
inspector/model/remote-object-dom.html
imported/w3c/web-platform-tests/html/browsers/the-window-object/window-prototype-chain.html
Comment 3 Build Bot 2019-06-23 18:01:36 PDT
Created attachment 372722 [details]
Archive of layout-test-results from ews102 for mac-highsierra

The attached test failures were seen while running run-webkit-tests on the mac-ews.
Bot: ews102  Port: mac-highsierra  Platform: Mac OS X 10.13.6
Comment 4 Build Bot 2019-06-23 18:09:15 PDT
Comment on attachment 372719 [details]
Patch

Attachment 372719 [details] did not pass mac-wk2-ews (mac-wk2):
Output: https://webkit-queues.webkit.org/results/12557916

New failing tests:
inspector/model/remote-object-get-properties.html
inspector/model/remote-object-dom.html
imported/w3c/web-platform-tests/html/browsers/the-window-object/window-prototype-chain.html
Comment 5 Build Bot 2019-06-23 18:09:16 PDT
Created attachment 372723 [details]
Archive of layout-test-results from ews105 for mac-highsierra-wk2

The attached test failures were seen while running run-webkit-tests on the mac-wk2-ews.
Bot: ews105  Port: mac-highsierra-wk2  Platform: Mac OS X 10.13.6
Comment 6 Build Bot 2019-06-23 18:34:51 PDT
Comment on attachment 372719 [details]
Patch

Attachment 372719 [details] did not pass jsc-ews (mac):
Output: https://webkit-queues.webkit.org/results/12557902

New failing tests:
wasm.yaml/wasm/js-api/test_basic_api.js.wasm-no-tls-context
wasm.yaml/wasm/js-api/test_basic_api.js.wasm-collect-continuously
wasm.yaml/wasm/spec-tests/jsapi.js.wasm-eager-jettison
wasm.yaml/wasm/spec-tests/jsapi.js.default-wasm
wasm.yaml/wasm/js-api/test_basic_api.js.wasm-no-call-ic
wasm.yaml/wasm/js-api/test_basic_api.js.wasm-slow-memory
wasm.yaml/wasm/js-api/test_basic_api.js.default-wasm
mozilla-tests.yaml/js1_5/Array/regress-101964.js.mozilla-baseline
wasm.yaml/wasm/js-api/test_basic_api.js.wasm-no-cjit-yes-tls-context
wasm.yaml/wasm/spec-tests/jsapi.js.wasm-no-air
wasm.yaml/wasm/spec-tests/jsapi.js.wasm-no-tls-context
wasm.yaml/wasm/spec-tests/jsapi.js.wasm-collect-continuously
wasm.yaml/wasm/spec-tests/jsapi.js.wasm-no-cjit-yes-tls-context
wasm.yaml/wasm/js-api/test_basic_api.js.wasm-no-air
wasm.yaml/wasm/js-api/test_basic_api.js.wasm-eager-jettison
wasm.yaml/wasm/spec-tests/jsapi.js.wasm-no-call-ic
apiTests
Comment 7 Build Bot 2019-06-23 18:38:08 PDT
Comment on attachment 372719 [details]
Patch

Attachment 372719 [details] did not pass mac-debug-ews (mac):
Output: https://webkit-queues.webkit.org/results/12557934

New failing tests:
inspector/model/remote-object-get-properties.html
inspector/model/remote-object-dom.html
imported/w3c/web-platform-tests/html/browsers/the-window-object/window-prototype-chain.html
Comment 8 Build Bot 2019-06-23 18:38:10 PDT
Created attachment 372725 [details]
Archive of layout-test-results from ews117 for mac-highsierra

The attached test failures were seen while running run-webkit-tests on the mac-debug-ews.
Bot: ews117  Port: mac-highsierra  Platform: Mac OS X 10.13.6
Comment 9 Build Bot 2019-06-23 18:47:21 PDT
Comment on attachment 372719 [details]
Patch

Attachment 372719 [details] did not pass ios-sim-ews (ios-simulator-wk2):
Output: https://webkit-queues.webkit.org/results/12557981

New failing tests:
imported/w3c/web-platform-tests/html/browsers/the-window-object/window-prototype-chain.html
Comment 10 Build Bot 2019-06-23 18:47:23 PDT
Created attachment 372726 [details]
Archive of layout-test-results from ews123 for ios-simulator-wk2

The attached test failures were seen while running run-webkit-tests on the ios-sim-ews.
Bot: ews123  Port: ios-simulator-wk2  Platform: Mac OS X 10.14.5
Comment 11 Alexey Shvayka 2019-06-24 05:53:47 PDT
Created attachment 372748 [details]
Patch

Add "WindowProperties" symbol and fix tests.
Comment 12 Alexey Shvayka 2019-06-24 10:47:37 PDT
Created attachment 372771 [details]
Patch

Adjust bindings tests.
Comment 13 Alexey Shvayka 2019-07-18 11:43:28 PDT
Created attachment 374400 [details]
Patch

Rebase and mark 4 more tests as passing.
Comment 14 Alexey Shvayka 2019-07-18 13:18:14 PDT
Created attachment 374407 [details]
Patch

Fix weird type conversion error.
Comment 15 Alexey Shvayka 2019-08-14 13:28:28 PDT
Adding Darin to CC in case he has some feedback on WebCore/bindings changes.