Skip to content

Commit

Permalink
Remove a workaround for rust-lang/rfcs#718
Browse files Browse the repository at this point in the history
  • Loading branch information
Eijebong committed Nov 1, 2017
1 parent 43a4f01 commit 516857a
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions components/script/dom/bindings/proxyhandler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@ use js::jsapi::GetStaticPrototype;
use js::jsapi::JS_GetPropertyDescriptorById;
use js::jsapi::MutableHandleObject;
use js::jsval::ObjectValue;
use libc;
use std::{mem, ptr};
use std::ptr;


static JSPROXYSLOT_EXPANDO: u32 = 0;
Expand Down Expand Up @@ -91,11 +90,7 @@ pub unsafe extern "C" fn define_property(cx: *mut JSContext,
desc: Handle<PropertyDescriptor>,
result: *mut ObjectOpResult)
-> bool {
// FIXME: Workaround for https://github.com/rust-lang/rfcs/issues/718
let setter: *const libc::c_void = mem::transmute(desc.get().setter);
let setter_stub: unsafe extern fn(_, _, _, _, _) -> _ = JS_StrictPropertyStub;
let setter_stub: *const libc::c_void = mem::transmute(setter_stub);
if (desc.get().attrs & JSPROP_GETTER) != 0 && setter == setter_stub {
if (desc.get().attrs & JSPROP_GETTER) != 0 && desc.get().setter == Some(JS_StrictPropertyStub) {
(*result).code_ = JSErrNum::JSMSG_GETTER_ONLY as ::libc::uintptr_t;
return true;
}
Expand Down

0 comments on commit 516857a

Please sign in to comment.