mirror of
https://github.com/servo/servo.git
synced 2025-10-01 09:09:15 +01:00
Make console methods take any
instead of string
(#31241)
* Make console methods use `any` for the message Match the Console spec by allowing any value to be passed to console methods, instead of just values that can be converted to a string. Signed-off-by: syvb <me@iter.ca> * Add test for console logging a Symbol Signed-off-by: syvb <me@iter.ca> * Implement object stringification for logs Signed-off-by: syvb <me@iter.ca> * Address review comments Signed-off-by: syvb <me@iter.ca> * Make time/timeEnd accept DOMString to match spec * Update WPT results for layout 2013 --------- Signed-off-by: syvb <me@iter.ca>
This commit is contained in:
parent
4758ffabca
commit
50c930866b
20 changed files with 545 additions and 40 deletions
|
@ -3,6 +3,8 @@ skip: true
|
|||
skip: false
|
||||
[_webgl]
|
||||
skip: false
|
||||
[console]
|
||||
skip: false
|
||||
[cookies]
|
||||
skip: false
|
||||
[samesite]
|
||||
|
|
|
@ -0,0 +1,11 @@
|
|||
[console-is-a-namespace.any.shadowrealm.html]
|
||||
expected: ERROR
|
||||
|
||||
[console-is-a-namespace.any.html]
|
||||
[The prototype chain must be correct]
|
||||
expected: FAIL
|
||||
|
||||
|
||||
[console-is-a-namespace.any.worker.html]
|
||||
[The prototype chain must be correct]
|
||||
expected: FAIL
|
|
@ -0,0 +1,38 @@
|
|||
[console-label-conversion.any.html]
|
||||
[console.count()'s label gets converted to string via label.toString() when label is an object]
|
||||
expected: FAIL
|
||||
|
||||
[console.count() throws exceptions generated by erroneous label.toString() conversion]
|
||||
expected: FAIL
|
||||
|
||||
[console.countReset()'s label gets converted to string via label.toString() when label is an object]
|
||||
expected: FAIL
|
||||
|
||||
[console.countReset() throws exceptions generated by erroneous label.toString() conversion]
|
||||
expected: FAIL
|
||||
|
||||
[console.timeLog()'s label gets converted to string via label.toString() when label is an object]
|
||||
expected: FAIL
|
||||
|
||||
[console.timeLog() throws exceptions generated by erroneous label.toString() conversion]
|
||||
expected: FAIL
|
||||
|
||||
|
||||
[console-label-conversion.any.worker.html]
|
||||
[console.count()'s label gets converted to string via label.toString() when label is an object]
|
||||
expected: FAIL
|
||||
|
||||
[console.count() throws exceptions generated by erroneous label.toString() conversion]
|
||||
expected: FAIL
|
||||
|
||||
[console.countReset()'s label gets converted to string via label.toString() when label is an object]
|
||||
expected: FAIL
|
||||
|
||||
[console.countReset() throws exceptions generated by erroneous label.toString() conversion]
|
||||
expected: FAIL
|
||||
|
||||
[console.timeLog()'s label gets converted to string via label.toString() when label is an object]
|
||||
expected: FAIL
|
||||
|
||||
[console.timeLog() throws exceptions generated by erroneous label.toString() conversion]
|
||||
expected: FAIL
|
|
@ -0,0 +1,6 @@
|
|||
[console-log-symbol.any.html]
|
||||
|
||||
[console-log-symbol.any.shadowrealm.html]
|
||||
expected: ERROR
|
||||
|
||||
[console-log-symbol.any.worker.html]
|
|
@ -0,0 +1,26 @@
|
|||
[console-namespace-object-class-string.any.worker.html]
|
||||
[@@toStringTag exists on the namespace object with the appropriate descriptor]
|
||||
expected: FAIL
|
||||
|
||||
[Object.prototype.toString applied to the namespace object]
|
||||
expected: FAIL
|
||||
|
||||
[Object.prototype.toString applied after modifying the namespace object's @@toStringTag]
|
||||
expected: FAIL
|
||||
|
||||
[Object.prototype.toString applied after deleting @@toStringTag]
|
||||
expected: FAIL
|
||||
|
||||
|
||||
[console-namespace-object-class-string.any.html]
|
||||
[@@toStringTag exists on the namespace object with the appropriate descriptor]
|
||||
expected: FAIL
|
||||
|
||||
[Object.prototype.toString applied to the namespace object]
|
||||
expected: FAIL
|
||||
|
||||
[Object.prototype.toString applied after modifying the namespace object's @@toStringTag]
|
||||
expected: FAIL
|
||||
|
||||
[Object.prototype.toString applied after deleting @@toStringTag]
|
||||
expected: FAIL
|
|
@ -0,0 +1,6 @@
|
|||
[console-tests-historical.any.worker.html]
|
||||
|
||||
[console-tests-historical.any.shadowrealm.html]
|
||||
expected: ERROR
|
||||
|
||||
[console-tests-historical.any.html]
|
|
@ -0,0 +1,2 @@
|
|||
[idlharness-shadowrealm.window.html]
|
||||
expected: ERROR
|
68
tests/wpt/meta-legacy-layout/console/idlharness.any.js.ini
Normal file
68
tests/wpt/meta-legacy-layout/console/idlharness.any.js.ini
Normal file
|
@ -0,0 +1,68 @@
|
|||
[idlharness.any.worker.html]
|
||||
[console namespace: [[Prototype\]\] is Object.prototype]
|
||||
expected: FAIL
|
||||
|
||||
[console namespace: operation assert(optional boolean, any...)]
|
||||
expected: FAIL
|
||||
|
||||
[console namespace: operation table(optional any, optional sequence<DOMString>)]
|
||||
expected: FAIL
|
||||
|
||||
[console namespace: operation trace(any...)]
|
||||
expected: FAIL
|
||||
|
||||
[console namespace: operation dir(optional any, optional object?)]
|
||||
expected: FAIL
|
||||
|
||||
[console namespace: operation dirxml(any...)]
|
||||
expected: FAIL
|
||||
|
||||
[console namespace: operation count(optional DOMString)]
|
||||
expected: FAIL
|
||||
|
||||
[console namespace: operation countReset(optional DOMString)]
|
||||
expected: FAIL
|
||||
|
||||
[console namespace: operation time(optional DOMString)]
|
||||
expected: FAIL
|
||||
|
||||
[console namespace: operation timeLog(optional DOMString, any...)]
|
||||
expected: FAIL
|
||||
|
||||
[console namespace: operation timeEnd(optional DOMString)]
|
||||
expected: FAIL
|
||||
|
||||
|
||||
[idlharness.any.html]
|
||||
[console namespace: [[Prototype\]\] is Object.prototype]
|
||||
expected: FAIL
|
||||
|
||||
[console namespace: operation assert(optional boolean, any...)]
|
||||
expected: FAIL
|
||||
|
||||
[console namespace: operation table(optional any, optional sequence<DOMString>)]
|
||||
expected: FAIL
|
||||
|
||||
[console namespace: operation trace(any...)]
|
||||
expected: FAIL
|
||||
|
||||
[console namespace: operation dir(optional any, optional object?)]
|
||||
expected: FAIL
|
||||
|
||||
[console namespace: operation dirxml(any...)]
|
||||
expected: FAIL
|
||||
|
||||
[console namespace: operation count(optional DOMString)]
|
||||
expected: FAIL
|
||||
|
||||
[console namespace: operation countReset(optional DOMString)]
|
||||
expected: FAIL
|
||||
|
||||
[console namespace: operation time(optional DOMString)]
|
||||
expected: FAIL
|
||||
|
||||
[console namespace: operation timeLog(optional DOMString, any...)]
|
||||
expected: FAIL
|
||||
|
||||
[console namespace: operation timeEnd(optional DOMString)]
|
||||
expected: FAIL
|
|
@ -517775,6 +517775,42 @@
|
|||
{}
|
||||
]
|
||||
],
|
||||
"console-log-symbol.any.js": [
|
||||
"a2facb6c64e86428383260735ed2df3e88c2c809",
|
||||
[
|
||||
"console/console-log-symbol.any.html",
|
||||
{
|
||||
"script_metadata": [
|
||||
[
|
||||
"global",
|
||||
"window,dedicatedworker,shadowrealm"
|
||||
]
|
||||
]
|
||||
}
|
||||
],
|
||||
[
|
||||
"console/console-log-symbol.any.shadowrealm.html",
|
||||
{
|
||||
"script_metadata": [
|
||||
[
|
||||
"global",
|
||||
"window,dedicatedworker,shadowrealm"
|
||||
]
|
||||
]
|
||||
}
|
||||
],
|
||||
[
|
||||
"console/console-log-symbol.any.worker.html",
|
||||
{
|
||||
"script_metadata": [
|
||||
[
|
||||
"global",
|
||||
"window,dedicatedworker,shadowrealm"
|
||||
]
|
||||
]
|
||||
}
|
||||
]
|
||||
],
|
||||
"console-namespace-object-class-string.any.js": [
|
||||
"d3ff7f7d07636154080f4d24106e1a6703c37dc4",
|
||||
[
|
||||
|
|
12
tests/wpt/meta/console/console-is-a-namespace.any.js.ini
Normal file
12
tests/wpt/meta/console/console-is-a-namespace.any.js.ini
Normal file
|
@ -0,0 +1,12 @@
|
|||
[console-is-a-namespace.any.worker.html]
|
||||
[The prototype chain must be correct]
|
||||
expected: FAIL
|
||||
|
||||
|
||||
[console-is-a-namespace.any.html]
|
||||
[The prototype chain must be correct]
|
||||
expected: FAIL
|
||||
|
||||
|
||||
[console-is-a-namespace.any.shadowrealm.html]
|
||||
expected: ERROR
|
38
tests/wpt/meta/console/console-label-conversion.any.js.ini
Normal file
38
tests/wpt/meta/console/console-label-conversion.any.js.ini
Normal file
|
@ -0,0 +1,38 @@
|
|||
[console-label-conversion.any.html]
|
||||
[console.count()'s label gets converted to string via label.toString() when label is an object]
|
||||
expected: FAIL
|
||||
|
||||
[console.count() throws exceptions generated by erroneous label.toString() conversion]
|
||||
expected: FAIL
|
||||
|
||||
[console.countReset()'s label gets converted to string via label.toString() when label is an object]
|
||||
expected: FAIL
|
||||
|
||||
[console.countReset() throws exceptions generated by erroneous label.toString() conversion]
|
||||
expected: FAIL
|
||||
|
||||
[console.timeLog()'s label gets converted to string via label.toString() when label is an object]
|
||||
expected: FAIL
|
||||
|
||||
[console.timeLog() throws exceptions generated by erroneous label.toString() conversion]
|
||||
expected: FAIL
|
||||
|
||||
|
||||
[console-label-conversion.any.worker.html]
|
||||
[console.count()'s label gets converted to string via label.toString() when label is an object]
|
||||
expected: FAIL
|
||||
|
||||
[console.count() throws exceptions generated by erroneous label.toString() conversion]
|
||||
expected: FAIL
|
||||
|
||||
[console.countReset()'s label gets converted to string via label.toString() when label is an object]
|
||||
expected: FAIL
|
||||
|
||||
[console.countReset() throws exceptions generated by erroneous label.toString() conversion]
|
||||
expected: FAIL
|
||||
|
||||
[console.timeLog()'s label gets converted to string via label.toString() when label is an object]
|
||||
expected: FAIL
|
||||
|
||||
[console.timeLog() throws exceptions generated by erroneous label.toString() conversion]
|
||||
expected: FAIL
|
6
tests/wpt/meta/console/console-log-symbol.any.js.ini
Normal file
6
tests/wpt/meta/console/console-log-symbol.any.js.ini
Normal file
|
@ -0,0 +1,6 @@
|
|||
[console-log-symbol.any.shadowrealm.html]
|
||||
expected: ERROR
|
||||
|
||||
[console-log-symbol.any.html]
|
||||
|
||||
[console-log-symbol.any.worker.html]
|
|
@ -0,0 +1,26 @@
|
|||
[console-namespace-object-class-string.any.html]
|
||||
[@@toStringTag exists on the namespace object with the appropriate descriptor]
|
||||
expected: FAIL
|
||||
|
||||
[Object.prototype.toString applied to the namespace object]
|
||||
expected: FAIL
|
||||
|
||||
[Object.prototype.toString applied after modifying the namespace object's @@toStringTag]
|
||||
expected: FAIL
|
||||
|
||||
[Object.prototype.toString applied after deleting @@toStringTag]
|
||||
expected: FAIL
|
||||
|
||||
|
||||
[console-namespace-object-class-string.any.worker.html]
|
||||
[@@toStringTag exists on the namespace object with the appropriate descriptor]
|
||||
expected: FAIL
|
||||
|
||||
[Object.prototype.toString applied to the namespace object]
|
||||
expected: FAIL
|
||||
|
||||
[Object.prototype.toString applied after modifying the namespace object's @@toStringTag]
|
||||
expected: FAIL
|
||||
|
||||
[Object.prototype.toString applied after deleting @@toStringTag]
|
||||
expected: FAIL
|
|
@ -0,0 +1,6 @@
|
|||
[console-tests-historical.any.worker.html]
|
||||
|
||||
[console-tests-historical.any.shadowrealm.html]
|
||||
expected: ERROR
|
||||
|
||||
[console-tests-historical.any.html]
|
|
@ -0,0 +1,2 @@
|
|||
[idlharness-shadowrealm.window.html]
|
||||
expected: ERROR
|
68
tests/wpt/meta/console/idlharness.any.js.ini
Normal file
68
tests/wpt/meta/console/idlharness.any.js.ini
Normal file
|
@ -0,0 +1,68 @@
|
|||
[idlharness.any.html]
|
||||
[console namespace: [[Prototype\]\] is Object.prototype]
|
||||
expected: FAIL
|
||||
|
||||
[console namespace: operation assert(optional boolean, any...)]
|
||||
expected: FAIL
|
||||
|
||||
[console namespace: operation table(optional any, optional sequence<DOMString>)]
|
||||
expected: FAIL
|
||||
|
||||
[console namespace: operation trace(any...)]
|
||||
expected: FAIL
|
||||
|
||||
[console namespace: operation dir(optional any, optional object?)]
|
||||
expected: FAIL
|
||||
|
||||
[console namespace: operation dirxml(any...)]
|
||||
expected: FAIL
|
||||
|
||||
[console namespace: operation count(optional DOMString)]
|
||||
expected: FAIL
|
||||
|
||||
[console namespace: operation countReset(optional DOMString)]
|
||||
expected: FAIL
|
||||
|
||||
[console namespace: operation time(optional DOMString)]
|
||||
expected: FAIL
|
||||
|
||||
[console namespace: operation timeLog(optional DOMString, any...)]
|
||||
expected: FAIL
|
||||
|
||||
[console namespace: operation timeEnd(optional DOMString)]
|
||||
expected: FAIL
|
||||
|
||||
|
||||
[idlharness.any.worker.html]
|
||||
[console namespace: [[Prototype\]\] is Object.prototype]
|
||||
expected: FAIL
|
||||
|
||||
[console namespace: operation assert(optional boolean, any...)]
|
||||
expected: FAIL
|
||||
|
||||
[console namespace: operation table(optional any, optional sequence<DOMString>)]
|
||||
expected: FAIL
|
||||
|
||||
[console namespace: operation trace(any...)]
|
||||
expected: FAIL
|
||||
|
||||
[console namespace: operation dir(optional any, optional object?)]
|
||||
expected: FAIL
|
||||
|
||||
[console namespace: operation dirxml(any...)]
|
||||
expected: FAIL
|
||||
|
||||
[console namespace: operation count(optional DOMString)]
|
||||
expected: FAIL
|
||||
|
||||
[console namespace: operation countReset(optional DOMString)]
|
||||
expected: FAIL
|
||||
|
||||
[console namespace: operation time(optional DOMString)]
|
||||
expected: FAIL
|
||||
|
||||
[console namespace: operation timeLog(optional DOMString, any...)]
|
||||
expected: FAIL
|
||||
|
||||
[console namespace: operation timeEnd(optional DOMString)]
|
||||
expected: FAIL
|
10
tests/wpt/tests/console/console-log-symbol.any.js
Normal file
10
tests/wpt/tests/console/console-log-symbol.any.js
Normal file
|
@ -0,0 +1,10 @@
|
|||
// META: global=window,dedicatedworker,shadowrealm
|
||||
"use strict";
|
||||
// https://console.spec.whatwg.org/
|
||||
|
||||
test(() => {
|
||||
console.log(Symbol());
|
||||
console.log(Symbol("abc"));
|
||||
console.log(Symbol.for("def"));
|
||||
console.log(Symbol.isConcatSpreadable);
|
||||
}, "Logging a symbol doesn't throw");
|
Loading…
Add table
Add a link
Reference in a new issue