Source code
Revision control
Copy as Markdown
Other Tools
Test Info:
- This WPT test may be referenced by the following Test IDs:
- /html/browsers/origin/tentative/api/origin-from.any.html - WPT Dashboard Interop Dashboard
- /html/browsers/origin/tentative/api/origin-from.any.worker.html - WPT Dashboard Interop Dashboard
// META: title=`Origin.from()`
// META: script=resources/serializations.js
//
// Invalid Inputs: `null`, `undefined`, invalid URL strings, random objects.
//
const invalidInputs = [
null,
undefined,
1,
1.1,
true,
{},
Object,
Origin,
Origin.from,
];
for (const invalid of invalidInputs) {
test(t => {
assert_throws_js(TypeError, _ => Origin.from(invalid));
}, `Origin.from(${invalid}) throws a TypeError.`);
}
// Specific object types are tested in `origin-from-*.js` in this directory.