mirror of
https://github.com/servo/servo.git
synced 2025-08-04 13:10:20 +01:00
Rename HasPropertyOnPrototype to has_property_on_prototype.
This commit is contained in:
parent
59909efff1
commit
69c4c8223c
2 changed files with 5 additions and 4 deletions
|
@ -3680,7 +3680,7 @@ class CGDOMJSProxyHandler_getOwnPropertyDescriptor(CGAbstractExternMethod):
|
||||||
# ResolveOwnProperty or EnumerateOwnProperties filter out named
|
# ResolveOwnProperty or EnumerateOwnProperties filter out named
|
||||||
# properties that shadow prototype properties.
|
# properties that shadow prototype properties.
|
||||||
namedGet = ("\n" +
|
namedGet = ("\n" +
|
||||||
"if !set && RUST_JSID_IS_STRING(id) != 0 && !HasPropertyOnPrototype(cx, proxy, id) {\n" +
|
"if !set && RUST_JSID_IS_STRING(id) != 0 && !has_property_on_prototype(cx, proxy, id) {\n" +
|
||||||
" let name = jsid_to_str(cx, id);\n" +
|
" let name = jsid_to_str(cx, id);\n" +
|
||||||
" let this = UnwrapProxy(proxy);\n" +
|
" let this = UnwrapProxy(proxy);\n" +
|
||||||
" let this = JS::from_raw(this);\n" +
|
" let this = JS::from_raw(this);\n" +
|
||||||
|
@ -3815,7 +3815,7 @@ class CGDOMJSProxyHandler_hasOwn(CGAbstractExternMethod):
|
||||||
|
|
||||||
namedGetter = self.descriptor.operations['NamedGetter']
|
namedGetter = self.descriptor.operations['NamedGetter']
|
||||||
if namedGetter:
|
if namedGetter:
|
||||||
named = ("if RUST_JSID_IS_STRING(id) != 0 && !HasPropertyOnPrototype(cx, proxy, id) {\n" +
|
named = ("if RUST_JSID_IS_STRING(id) != 0 && !has_property_on_prototype(cx, proxy, id) {\n" +
|
||||||
" let name = jsid_to_str(cx, id);\n" +
|
" let name = jsid_to_str(cx, id);\n" +
|
||||||
" let this = UnwrapProxy(proxy);\n" +
|
" let this = UnwrapProxy(proxy);\n" +
|
||||||
" let this = JS::from_raw(this);\n" +
|
" let this = JS::from_raw(this);\n" +
|
||||||
|
@ -4554,7 +4554,7 @@ class CGBindingRoot(CGThing):
|
||||||
'dom::bindings::utils::{DOMJSClass, JSCLASS_DOM_GLOBAL}',
|
'dom::bindings::utils::{DOMJSClass, JSCLASS_DOM_GLOBAL}',
|
||||||
'dom::bindings::utils::{find_enum_string_index, get_array_index_from_id}',
|
'dom::bindings::utils::{find_enum_string_index, get_array_index_from_id}',
|
||||||
'dom::bindings::utils::{get_property_on_prototype, get_proto_or_iface_array}',
|
'dom::bindings::utils::{get_property_on_prototype, get_proto_or_iface_array}',
|
||||||
'dom::bindings::utils::HasPropertyOnPrototype',
|
'dom::bindings::utils::has_property_on_prototype',
|
||||||
'dom::bindings::utils::is_platform_object',
|
'dom::bindings::utils::is_platform_object',
|
||||||
'dom::bindings::utils::{Reflectable}',
|
'dom::bindings::utils::{Reflectable}',
|
||||||
'dom::bindings::utils::{squirrel_away_unique}',
|
'dom::bindings::utils::{squirrel_away_unique}',
|
||||||
|
|
|
@ -552,7 +552,8 @@ pub fn get_dictionary_property(cx: *mut JSContext,
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Returns whether `proxy` has a property `id` on its prototype.
|
/// Returns whether `proxy` has a property `id` on its prototype.
|
||||||
pub fn HasPropertyOnPrototype(cx: *mut JSContext, proxy: *mut JSObject, id: jsid) -> bool {
|
pub fn has_property_on_prototype(cx: *mut JSContext, proxy: *mut JSObject,
|
||||||
|
id: jsid) -> bool {
|
||||||
// MOZ_ASSERT(js::IsProxy(proxy) && js::GetProxyHandler(proxy) == handler);
|
// MOZ_ASSERT(js::IsProxy(proxy) && js::GetProxyHandler(proxy) == handler);
|
||||||
let mut found = false;
|
let mut found = false;
|
||||||
return !get_property_on_prototype(cx, proxy, id, &mut found, ptr::null_mut()) || found;
|
return !get_property_on_prototype(cx, proxy, id, &mut found, ptr::null_mut()) || found;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue