Source code
Revision control
Copy as Markdown
Other Tools
Test Info:
- Manifest: js/xpconnect/tests/unit/xpcshell.toml
/* 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
add_task(async function testShared() {
global: "shared",
});
Assert.equal(ns1, ns2);
Assert.equal(ns1.obj, ns2.obj);
});
add_task(async function testDevTools() {
global: "devtools",
});
Assert.notEqual(ns1, ns2);
Assert.notEqual(ns1.obj, ns2.obj);
});
add_task(async function testInvalidOptions() {
// Unknown value is rejected.
Assert.throws(() => {
global: "invalid",
});
}, Error);
Assert.throws(() => {
global: globalThis,
});
}, Error);
// Unknown name is ignored.
global2: "shared",
});
});