Source code
Revision control
Copy as Markdown
Other Tools
Test Info:
- This WPT test may be referenced by the following Test IDs:
- /url/url-setters-lone-surrogates.any.html - WPT Dashboard Interop Dashboard
- /url/url-setters-lone-surrogates.any.worker.html - WPT Dashboard Interop Dashboard
// Not in setters_tests.json since lone surrogates are not portable JSON.
[{
property: 'pathname',
newValue: '\uDC01\uD802a',
}
},
{
property: 'search',
newValue: '\uDC01\uD802a',
}
},
{
property: 'hash',
newValue: '\uDC01\uD802a',
}
},
{
property: 'host',
newValue: 'exa\uDC01\uD802mple.com',
},
{
property: 'hostname',
newValue: 'exa\uDC01\uD802mple.com',
}].forEach(({property, newValue, expected}) => {
test(() => {
url[property] = newValue;
for (const [key, value] of Object.entries(expected)) {
assert_equals(url[key], value, key);
}
}, `Setting ${property} to a value with lone surrogates`);
});