Skip to content

Commit fa93a79

Browse files
author
bors-servo
authored
Auto merge of #19082 - Eijebong:fixme_issue_718, r=jdm
Remove a workaround for rust-lang/rfcs#718 <!-- Reviewable:start --> This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/19082) <!-- Reviewable:end -->
2 parents 994ff4b + 516857a commit fa93a79

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

components/script/dom/bindings/proxyhandler.rs

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,7 @@ use js::jsapi::GetStaticPrototype;
2020
use js::jsapi::JS_GetPropertyDescriptorById;
2121
use js::jsapi::MutableHandleObject;
2222
use js::jsval::ObjectValue;
23-
use libc;
24-
use std::{mem, ptr};
23+
use std::ptr;
2524

2625

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

0 commit comments

Comments
 (0)