Skip to content

Commit 440c867

Browse files
committed
try/catch, but it's suboptimal; see web-platform-tests/wpt#2830 (comment)
1 parent ab914ed commit 440c867

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

test/web-platform.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,13 @@ function testURL(expected) {
3636
function testSetterCase(testCase, propertyName) {
3737
return () => {
3838
const url = new URL(testCase.href);
39-
url[propertyName] = testCase.new_value;
39+
try {
40+
url[propertyName] = testCase.new_value;
41+
} catch (e) {
42+
if (!(e instanceof TypeError)) {
43+
throw e;
44+
}
45+
}
4046

4147
for (const expectedProperty in testCase.expected) {
4248
assert.equal(url[expectedProperty], testCase.expected[expectedProperty]);

0 commit comments

Comments
 (0)