Skip to content

Commit

Permalink
Throw on bad ByteStrings
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelwu committed Oct 14, 2015
1 parent e733a7c commit 3129fb2
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 1 deletion.
2 changes: 1 addition & 1 deletion components/script/dom/bindings/conversions.rs
Expand Up @@ -577,7 +577,7 @@ impl FromJSValConvertible for ByteString {
let char_vec = slice::from_raw_parts(chars, length as usize);

if char_vec.iter().any(|&c| c > 0xFF) {
// XXX Throw
throw_type_error(cx, "Invalid ByteString");
Err(())
} else {
Ok(ByteString::new(char_vec.iter().map(|&c| c as u8).collect()))
Expand Down
@@ -0,0 +1,8 @@
[setrequestheader-bogus-name.htm]
type: testharness
[setRequestHeader should throw with header name "テスト".]
expected: FAIL

[setRequestHeader should throw with header name "X-テスト".]
expected: FAIL

@@ -0,0 +1,5 @@
[setrequestheader-bogus-value.htm]
type: testharness
[XMLHttpRequest: setRequestHeader() value argument checks 4]
expected: FAIL

0 comments on commit 3129fb2

Please sign in to comment.