Skip to content

Commit

Permalink
Uses assert_throws instead of explicit try/catch
Browse files Browse the repository at this point in the history
  • Loading branch information
samfoo committed Dec 3, 2015
1 parent 9668500 commit 7ba4391
Showing 1 changed file with 2 additions and 8 deletions.
Expand Up @@ -39,15 +39,9 @@ <h1>Text input element</h1>

test(
function() {
try {
assert_throws("INDEX_SIZE_ERR", function() {
document.getElementById("assign-negative").maxLength = -5;
} catch (e) {
if (e.name == "IndexSizeError") {
return;
}
}

throw new Error("expected IndexSizeError");
});
}, "Assigning negative integer throws IndexSizeError");

test(
Expand Down

0 comments on commit 7ba4391

Please sign in to comment.