aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/xmlhttprequest.rs
diff options
context:
space:
mode:
authorbors-servo <metajack+bors@gmail.com>2015-10-14 14:48:44 -0600
committerbors-servo <metajack+bors@gmail.com>2015-10-14 14:48:44 -0600
commitb34fd5bd7e55be1d577df5cf70b41af8a6cc716b (patch)
treeda75856d209b23755de169dcbfe798afb0487a4a /components/script/dom/xmlhttprequest.rs
parentf35f809938792fbad61fd517187e46c1e009cd16 (diff)
parent3129fb2330251a38d0025766c28855eaa197afb8 (diff)
downloadservo-b34fd5bd7e55be1d577df5cf70b41af8a6cc716b.tar.gz
servo-b34fd5bd7e55be1d577df5cf70b41af8a6cc716b.zip
Auto merge of #7727 - michaelwu:update-bindings, r=jdm
Support the updated spidermonkey bindings Still need to finish the rust-mozjs update and make cargo use it, but it's close enough that I don't expect much to change on the servo side. Some changes here - bools are properly translated now - char16_t is handled as u16 now - JS_GlobalObjectTraceHook isn't mangled now - JSJitInfo has been adjusted - A const fn is used to generate bitfields in JSJitInfo - Manually generating handles now requires calling an unsafe function. It's not actually required, but it's too much of a hassle to generate them manually now due to bindgen++ adding base classes now. <!-- Reviewable:start --> [<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7727) <!-- Reviewable:end -->
Diffstat (limited to 'components/script/dom/xmlhttprequest.rs')
-rw-r--r--components/script/dom/xmlhttprequest.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/components/script/dom/xmlhttprequest.rs b/components/script/dom/xmlhttprequest.rs
index cbe1551f339..fb9a53ee5e8 100644
--- a/components/script/dom/xmlhttprequest.rs
+++ b/components/script/dom/xmlhttprequest.rs
@@ -692,10 +692,10 @@ impl XMLHttpRequestMethods for XMLHttpRequest {
let decoded = UTF_8.decode(&self.response.borrow(), DecoderTrap::Replace).unwrap().to_owned();
let decoded: Vec<u16> = decoded.utf16_units().collect();
unsafe {
- if JS_ParseJSON(cx,
- decoded.as_ptr() as *const i16,
- decoded.len() as u32,
- rval.handle_mut()) == 0 {
+ if !JS_ParseJSON(cx,
+ decoded.as_ptr(),
+ decoded.len() as u32,
+ rval.handle_mut()) {
JS_ClearPendingException(cx);
return NullValue();
}