Bug 1890793: Assert CallArgs::newTarget is not gray. r=spidermonkey-reviewers,sfink...
[gecko.git] / dom / console / tests / xpcshell / test_basic.js
blob5736912979efd72182e62718ecf105c31d327362
1 /* Any copyright is dedicated to the Public Domain.
2    http://creativecommons.org/publicdomain/zero/1.0/ */
4 add_task(async function () {
5   Assert.ok("console" in this);
7   let p = new Promise(resolve => {
8     function consoleListener() {
9       addConsoleStorageListener(this);
10     }
12     consoleListener.prototype = {
13       observe(aSubject) {
14         let obj = aSubject.wrappedJSObject;
15         Assert.ok(obj.arguments[0] === 42, "Message received!");
16         Assert.ok(obj.ID === "jsm", "The ID is JSM");
17         Assert.ok(obj.innerID.endsWith("test_basic.js"), "The innerID matches");
19         removeConsoleStorageListener(this);
20         resolve();
21       },
22     };
24     new consoleListener();
25   });
27   console.log(42);
28   await p;
29 });