mirror of
https://github.com/servo/servo.git
synced 2025-08-04 05:00:08 +01:00
Auto merge of #7107 - AdrianArroyoCalle:master, r=Ms2ger
Removed unused object_to_string method Closes #7100 <!-- Reviewable:start --> [<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7107) <!-- Reviewable:end -->
This commit is contained in:
commit
28abc55d9b
1 changed files with 2 additions and 16 deletions
|
@ -8,8 +8,8 @@
|
||||||
|
|
||||||
use dom::bindings::conversions::is_dom_proxy;
|
use dom::bindings::conversions::is_dom_proxy;
|
||||||
use dom::bindings::utils::delete_property_by_id;
|
use dom::bindings::utils::delete_property_by_id;
|
||||||
use js::jsapi::{JSContext, JSPropertyDescriptor, JSObject, JSString};
|
use js::jsapi::{JSContext, JSPropertyDescriptor, JSObject};
|
||||||
use js::jsapi::{JS_GetPropertyDescriptorById, JS_NewStringCopyN};
|
use js::jsapi::{JS_GetPropertyDescriptorById};
|
||||||
use js::jsapi::{JS_DefinePropertyById6, JS_NewObjectWithGivenProto};
|
use js::jsapi::{JS_DefinePropertyById6, JS_NewObjectWithGivenProto};
|
||||||
use js::jsapi::{JS_StrictPropertyStub, JSErrNum};
|
use js::jsapi::{JS_StrictPropertyStub, JSErrNum};
|
||||||
use js::jsapi::{Handle, HandleObject, HandleId, MutableHandle, RootedObject, ObjectOpResult};
|
use js::jsapi::{Handle, HandleObject, HandleId, MutableHandle, RootedObject, ObjectOpResult};
|
||||||
|
@ -107,20 +107,6 @@ pub unsafe extern fn is_extensible(_cx: *mut JSContext, _proxy: HandleObject,
|
||||||
return JSTrue;
|
return JSTrue;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Returns the stringification of an object with class `name`.
|
|
||||||
pub fn object_to_string(cx: *mut JSContext, name: &str) -> *mut JSString {
|
|
||||||
unsafe {
|
|
||||||
let result = format!("[object {}]", name);
|
|
||||||
|
|
||||||
let chars = result.as_ptr() as *const libc::c_char;
|
|
||||||
let length = result.len() as libc::size_t;
|
|
||||||
|
|
||||||
let string = JS_NewStringCopyN(cx, chars, length);
|
|
||||||
assert!(!string.is_null());
|
|
||||||
return string;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Get the expando object, or null if there is none.
|
/// Get the expando object, or null if there is none.
|
||||||
pub fn get_expando_object(obj: HandleObject) -> *mut JSObject {
|
pub fn get_expando_object(obj: HandleObject) -> *mut JSObject {
|
||||||
unsafe {
|
unsafe {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue