Rename GetExpandoObject to get_expando_object.

This commit is contained in:
Ms2ger 2015-01-29 17:19:45 +01:00
parent f84cbd4025
commit 0b9549746b
2 changed files with 7 additions and 7 deletions

View file

@ -3691,7 +3691,7 @@ class CGDOMJSProxyHandler_getOwnPropertyDescriptor(CGAbstractExternMethod):
namedGet = "" namedGet = ""
return setOrIndexedGet + """\ return setOrIndexedGet + """\
let expando: *mut JSObject = GetExpandoObject(proxy); let expando: *mut JSObject = get_expando_object(proxy);
//if (!xpc::WrapperFactory::IsXrayWrapper(proxy) && (expando = GetExpandoObject(proxy))) { //if (!xpc::WrapperFactory::IsXrayWrapper(proxy) && (expando = GetExpandoObject(proxy))) {
if !expando.is_null() { if !expando.is_null() {
let flags = if set { JSRESOLVE_ASSIGNING } else { 0 } | JSRESOLVE_QUALIFIED; let flags = if set { JSRESOLVE_ASSIGNING } else { 0 } | JSRESOLVE_QUALIFIED;
@ -3829,7 +3829,7 @@ class CGDOMJSProxyHandler_hasOwn(CGAbstractExternMethod):
named = "" named = ""
return indexed + """\ return indexed + """\
let expando: *mut JSObject = GetExpandoObject(proxy); let expando: *mut JSObject = get_expando_object(proxy);
if !expando.is_null() { if !expando.is_null() {
let mut b: JSBool = 1; let mut b: JSBool = 1;
let ok = JS_HasPropertyById(cx, expando, id, &mut b) != 0; let ok = JS_HasPropertyById(cx, expando, id, &mut b) != 0;
@ -3854,7 +3854,7 @@ class CGDOMJSProxyHandler_get(CGAbstractExternMethod):
self.descriptor = descriptor self.descriptor = descriptor
def getBody(self): def getBody(self):
getFromExpando = """\ getFromExpando = """\
let expando = GetExpandoObject(proxy); let expando = get_expando_object(proxy);
if !expando.is_null() { if !expando.is_null() {
let mut hasProp = 0; let mut hasProp = 0;
if JS_HasPropertyById(cx, expando, id, &mut hasProp) == 0 { if JS_HasPropertyById(cx, expando, id, &mut hasProp) == 0 {
@ -4580,7 +4580,7 @@ class CGBindingRoot(CGThing):
'dom::bindings::error::throw_dom_exception', 'dom::bindings::error::throw_dom_exception',
'dom::bindings::error::throw_type_error', 'dom::bindings::error::throw_type_error',
'dom::bindings::proxyhandler', 'dom::bindings::proxyhandler',
'dom::bindings::proxyhandler::{FillPropertyDescriptor, GetExpandoObject}', 'dom::bindings::proxyhandler::{FillPropertyDescriptor, get_expando_object}',
'dom::bindings::proxyhandler::{get_property_descriptor}', 'dom::bindings::proxyhandler::{get_property_descriptor}',
'dom::bindings::proxyhandler::{getOwnPropertyNames_, enumerate_}', 'dom::bindings::proxyhandler::{getOwnPropertyNames_, enumerate_}',
'dom::bindings::str::ByteString', 'dom::bindings::str::ByteString',

View file

@ -79,7 +79,7 @@ pub unsafe extern fn define_property(cx: *mut JSContext, proxy: *mut JSObject,
/// Deletes an expando off the given `proxy`. /// Deletes an expando off the given `proxy`.
pub unsafe extern fn delete(cx: *mut JSContext, proxy: *mut JSObject, id: jsid, pub unsafe extern fn delete(cx: *mut JSContext, proxy: *mut JSObject, id: jsid,
bp: *mut bool) -> bool { bp: *mut bool) -> bool {
let expando = GetExpandoObject(proxy); let expando = get_expando_object(proxy);
if expando.is_null() { if expando.is_null() {
*bp = true; *bp = true;
return true; return true;
@ -103,7 +103,7 @@ pub fn object_to_string(cx: *mut JSContext, name: &str) -> *mut JSString {
} }
/// Get the expando object, or null if there is none. /// Get the expando object, or null if there is none.
pub fn GetExpandoObject(obj: *mut JSObject) -> *mut JSObject { pub fn get_expando_object(obj: *mut JSObject) -> *mut JSObject {
unsafe { unsafe {
assert!(is_dom_proxy(obj)); assert!(is_dom_proxy(obj));
let val = GetProxyExtra(obj, JSPROXYSLOT_EXPANDO); let val = GetProxyExtra(obj, JSPROXYSLOT_EXPANDO);
@ -120,7 +120,7 @@ pub fn GetExpandoObject(obj: *mut JSObject) -> *mut JSObject {
pub fn EnsureExpandoObject(cx: *mut JSContext, obj: *mut JSObject) -> *mut JSObject { pub fn EnsureExpandoObject(cx: *mut JSContext, obj: *mut JSObject) -> *mut JSObject {
unsafe { unsafe {
assert!(is_dom_proxy(obj)); assert!(is_dom_proxy(obj));
let mut expando = GetExpandoObject(obj); let mut expando = get_expando_object(obj);
if expando.is_null() { if expando.is_null() {
expando = JS_NewObjectWithGivenProto(cx, ptr::null_mut(), expando = JS_NewObjectWithGivenProto(cx, ptr::null_mut(),
ptr::null_mut(), ptr::null_mut(),