mirror of
https://github.com/servo/servo.git
synced 2025-06-17 12:54:28 +00:00
Auto merge of #19082 - Eijebong:fixme_issue_718, r=jdm
Remove a workaround for https://github.com/rust-lang/rfcs/issues/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 -->
This commit is contained in:
commit
fa93a79ed0
1 changed files with 2 additions and 7 deletions
|
@ -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;
|
||||
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue