mirror of
https://github.com/servo/servo.git
synced 2025-07-24 07:40:27 +01:00
Rename FillPropertyDescriptor to fill_property_descriptor.
This commit is contained in:
parent
2592045ed4
commit
bcd9ca6081
3 changed files with 9 additions and 8 deletions
|
@ -3631,7 +3631,7 @@ class CGDOMJSProxyHandler_getOwnPropertyDescriptor(CGAbstractExternMethod):
|
||||||
|
|
||||||
if indexedGetter:
|
if indexedGetter:
|
||||||
readonly = toStringBool(self.descriptor.operations['IndexedSetter'] is None)
|
readonly = toStringBool(self.descriptor.operations['IndexedSetter'] is None)
|
||||||
fillDescriptor = "FillPropertyDescriptor(&mut *desc, proxy, %s);\nreturn true;" % readonly
|
fillDescriptor = "fill_property_descriptor(&mut *desc, proxy, %s);\nreturn true;" % readonly
|
||||||
templateValues = {'jsvalRef': '(*desc).value', 'successCode': fillDescriptor}
|
templateValues = {'jsvalRef': '(*desc).value', 'successCode': fillDescriptor}
|
||||||
get = ("if index.is_some() {\n" +
|
get = ("if index.is_some() {\n" +
|
||||||
" let index = index.unwrap();\n" +
|
" let index = index.unwrap();\n" +
|
||||||
|
@ -3649,7 +3649,7 @@ class CGDOMJSProxyHandler_getOwnPropertyDescriptor(CGAbstractExternMethod):
|
||||||
if not 'IndexedCreator' in self.descriptor.operations:
|
if not 'IndexedCreator' in self.descriptor.operations:
|
||||||
# FIXME need to check that this is a 'supported property index'
|
# FIXME need to check that this is a 'supported property index'
|
||||||
assert False
|
assert False
|
||||||
setOrIndexedGet += (" FillPropertyDescriptor(&mut *desc, proxy, false);\n" +
|
setOrIndexedGet += (" fill_property_descriptor(&mut *desc, proxy, false);\n" +
|
||||||
" return true;\n" +
|
" return true;\n" +
|
||||||
" }\n")
|
" }\n")
|
||||||
if self.descriptor.operations['NamedSetter']:
|
if self.descriptor.operations['NamedSetter']:
|
||||||
|
@ -3657,7 +3657,7 @@ class CGDOMJSProxyHandler_getOwnPropertyDescriptor(CGAbstractExternMethod):
|
||||||
if not 'NamedCreator' in self.descriptor.operations:
|
if not 'NamedCreator' in self.descriptor.operations:
|
||||||
# FIXME need to check that this is a 'supported property name'
|
# FIXME need to check that this is a 'supported property name'
|
||||||
assert False
|
assert False
|
||||||
setOrIndexedGet += (" FillPropertyDescriptor(&mut *desc, proxy, false);\n" +
|
setOrIndexedGet += (" fill_property_descriptor(&mut *desc, proxy, false);\n" +
|
||||||
" return true;\n" +
|
" return true;\n" +
|
||||||
" }\n")
|
" }\n")
|
||||||
setOrIndexedGet += "}"
|
setOrIndexedGet += "}"
|
||||||
|
@ -3674,7 +3674,7 @@ class CGDOMJSProxyHandler_getOwnPropertyDescriptor(CGAbstractExternMethod):
|
||||||
namedGetter = self.descriptor.operations['NamedGetter']
|
namedGetter = self.descriptor.operations['NamedGetter']
|
||||||
if namedGetter:
|
if namedGetter:
|
||||||
readonly = toStringBool(self.descriptor.operations['NamedSetter'] is None)
|
readonly = toStringBool(self.descriptor.operations['NamedSetter'] is None)
|
||||||
fillDescriptor = "FillPropertyDescriptor(&mut *desc, proxy, %s);\nreturn true;" % readonly
|
fillDescriptor = "fill_property_descriptor(&mut *desc, proxy, %s);\nreturn true;" % readonly
|
||||||
templateValues = {'jsvalRef': '(*desc).value', 'successCode': fillDescriptor}
|
templateValues = {'jsvalRef': '(*desc).value', 'successCode': fillDescriptor}
|
||||||
# Once we start supporting OverrideBuiltins we need to make
|
# Once we start supporting OverrideBuiltins we need to make
|
||||||
# ResolveOwnProperty or EnumerateOwnProperties filter out named
|
# ResolveOwnProperty or EnumerateOwnProperties filter out named
|
||||||
|
@ -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, get_expando_object}',
|
'dom::bindings::proxyhandler::{fill_property_descriptor, 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',
|
||||||
|
|
|
@ -136,7 +136,8 @@ pub fn ensure_expando_object(cx: *mut JSContext, obj: *mut JSObject)
|
||||||
|
|
||||||
/// Set the property descriptor's object to `obj` and set it to enumerable,
|
/// Set the property descriptor's object to `obj` and set it to enumerable,
|
||||||
/// and writable if `readonly` is true.
|
/// and writable if `readonly` is true.
|
||||||
pub fn FillPropertyDescriptor(desc: &mut JSPropertyDescriptor, obj: *mut JSObject, readonly: bool) {
|
pub fn fill_property_descriptor(desc: &mut JSPropertyDescriptor,
|
||||||
|
obj: *mut JSObject, readonly: bool) {
|
||||||
desc.obj = obj;
|
desc.obj = obj;
|
||||||
desc.attrs = if readonly { JSPROP_READONLY } else { 0 } | JSPROP_ENUMERATE;
|
desc.attrs = if readonly { JSPROP_READONLY } else { 0 } | JSPROP_ENUMERATE;
|
||||||
desc.getter = None;
|
desc.getter = None;
|
||||||
|
|
|
@ -7,7 +7,7 @@ use dom::bindings::conversions::{ToJSValConvertible};
|
||||||
use dom::bindings::js::{JS, JSRef, Temporary, Root};
|
use dom::bindings::js::{JS, JSRef, Temporary, Root};
|
||||||
use dom::bindings::js::{OptionalRootable, OptionalRootedRootable, ResultRootable};
|
use dom::bindings::js::{OptionalRootable, OptionalRootedRootable, ResultRootable};
|
||||||
use dom::bindings::js::{OptionalRootedReference, OptionalOptionalRootedRootable};
|
use dom::bindings::js::{OptionalRootedReference, OptionalOptionalRootedRootable};
|
||||||
use dom::bindings::proxyhandler::{get_property_descriptor, FillPropertyDescriptor};
|
use dom::bindings::proxyhandler::{get_property_descriptor, fill_property_descriptor};
|
||||||
use dom::bindings::utils::{Reflectable, WindowProxyHandler};
|
use dom::bindings::utils::{Reflectable, WindowProxyHandler};
|
||||||
use dom::bindings::utils::{GetArrayIndexFromId};
|
use dom::bindings::utils::{GetArrayIndexFromId};
|
||||||
use dom::document::{Document, DocumentHelpers};
|
use dom::document::{Document, DocumentHelpers};
|
||||||
|
@ -116,7 +116,7 @@ unsafe extern fn getOwnPropertyDescriptor(cx: *mut JSContext, proxy: *mut JSObje
|
||||||
if let Some(window) = window {
|
if let Some(window) = window {
|
||||||
let window = window.root();
|
let window = window.root();
|
||||||
(*desc).value = window.to_jsval(cx);
|
(*desc).value = window.to_jsval(cx);
|
||||||
FillPropertyDescriptor(&mut *desc, proxy, true);
|
fill_property_descriptor(&mut *desc, proxy, true);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue