Skip to content

Commit

Permalink
Throw RangeErrors in TextEncoder/TextDecoder constructors.
Browse files Browse the repository at this point in the history
Fixes #5620.
Fix the TODOs and FIXMEs to comply with the spec.
Add test case for passing invalid invalid labels.
Update test metadata; three test cases have been resolved upstream and
will be fixed whenever the rust-encoding dependency is sufficiently upgraded.
  • Loading branch information
aneeshusa authored and Ms2ger committed Apr 16, 2015
1 parent b9886e1 commit 791451f
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions encoding/api-invalid-label.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<!DOCTYPE html>
<title>Encoding API: invalid label</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script>

var invalidLabel = "invalid-invalidLabel"

test(function() {
assert_throws({name: 'RangeError'}, function() { new TextEncoder(invalidLabel); });
assert_throws({name: 'RangeError'}, function() { new TextDecoder(invalidLabel); });
}, 'Invalid label "' + invalidLabel + '" should be rejected by API.');

</script>

0 comments on commit 791451f

Please sign in to comment.