Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions NOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,3 +78,32 @@ Chrome:
console.log("%s %snewword", "duck")
duck %snewword
```

## console.assert

```
FF / Edge:

console.assert(false, "robert keeps %s on his balcony", "plaices")
robert keeps plaices on his balcony

Chrome:

console.assert(false, "robert keeps %s on his balcony", "plaices")
Assertion failed: robert keeps %s on his balcony plaices
```


## console.assert

```
FF / Edge:

console.assert(false, "robert keeps %s on his balcony", {foo: "bar"})
robert keeps [object Object] on his balcony

Chrome:

console.assert(false, "robert keeps %s on his balcony", {foo: "bar"})
Assertion failed: robert keeps %s on his balcony Object {foo: "bar"}
```
6 changes: 3 additions & 3 deletions index.bs
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ By the time the printer operation is called, all format specifiers will have bee
[NoInterfaceObject]
interface Console {
// Logging
void assert(boolean condition, optional any message);
void assert(boolean condition, optional any... data);
void clear();
void count(optional DOMString label = "");
void debug(any... data);
Expand Down Expand Up @@ -201,9 +201,9 @@ partial interface WorkerGlobalScope {

<h3 id="logging">Logging methods</h3>

<h4><dfn method for="Console">assert(<var>condition</var>, <var>message</var>)</dfn></h4>
<h4><dfn method for="Console">assert(<var>condition</var>, ...<var>data</var>)</dfn></h4>

If <var>condition</var> is false, perform Logger("error", «<var>message</var>»).
If <var>condition</var> is false, perform Logger("error", <var>data</var>).

<h4><dfn method for="Console">clear()</dfn></h4>

Expand Down