servo/components/script/dom/webidls/Console.webidl
Smitty 50c930866b
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>
2024-02-05 14:30:53 +00:00

28 lines
816 B
Text

/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
// https://console.spec.whatwg.org/
[ClassString="Console",
Exposed=(Window,Worker,Worklet),
ProtoObjectHack]
namespace console {
// Logging
undefined log(any... messages);
undefined debug(any... messages);
undefined info(any... messages);
undefined warn(any... messages);
undefined error(any... messages);
undefined assert(boolean condition, optional any message);
undefined clear();
// Grouping
undefined group(any... data);
undefined groupCollapsed(any... data);
undefined groupEnd();
// Timing
undefined time(DOMString message);
undefined timeEnd(DOMString message);
};