mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
Rename IsPlatformObject to is_platform_object.
This commit is contained in:
parent
a0f5250cb8
commit
59909efff1
2 changed files with 9 additions and 8 deletions
|
@ -336,7 +336,7 @@ class CGMethodCall(CGThing):
|
|||
|
||||
# Check for vanilla JS objects
|
||||
# XXXbz Do we need to worry about security wrappers?
|
||||
pickFirstSignature("%s.is_object() && !IsPlatformObject(%s.to_object())" %
|
||||
pickFirstSignature("%s.is_object() && !is_platform_object(%s.to_object())" %
|
||||
(distinguishingArg, distinguishingArg),
|
||||
lambda s: (s[1][distinguishingIndex].type.isCallback() or
|
||||
s[1][distinguishingIndex].type.isCallbackInterface() or
|
||||
|
@ -719,7 +719,7 @@ def getJSToNativeConversionTemplate(type, descriptorProvider, failureCode=None,
|
|||
handleInvalidEnumValueCode = "return 1;"
|
||||
|
||||
template = (
|
||||
"match FindEnumStringIndex(cx, ${val}, %(values)s) {\n"
|
||||
"match find_enum_string_index(cx, ${val}, %(values)s) {\n"
|
||||
" Err(_) => { %(exceptionCode)s },\n"
|
||||
" Ok(None) => { %(handleInvalidEnumValueCode)s },\n"
|
||||
" Ok(Some(index)) => {\n"
|
||||
|
@ -4552,10 +4552,10 @@ class CGBindingRoot(CGThing):
|
|||
'dom::bindings::utils::ConstantSpec',
|
||||
'dom::bindings::utils::{DOMClass}',
|
||||
'dom::bindings::utils::{DOMJSClass, JSCLASS_DOM_GLOBAL}',
|
||||
'dom::bindings::utils::{FindEnumStringIndex, 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::HasPropertyOnPrototype',
|
||||
'dom::bindings::utils::IsPlatformObject',
|
||||
'dom::bindings::utils::is_platform_object',
|
||||
'dom::bindings::utils::{Reflectable}',
|
||||
'dom::bindings::utils::{squirrel_away_unique}',
|
||||
'dom::bindings::utils::throwing_constructor',
|
||||
|
|
|
@ -462,9 +462,10 @@ pub fn get_array_index_from_id(_cx: *mut JSContext, id: jsid) -> Option<u32> {
|
|||
/// Find the index of a string given by `v` in `values`.
|
||||
/// Returns `Err(())` on JSAPI failure (there is a pending exception), and
|
||||
/// `Ok(None)` if there was no matching string.
|
||||
pub fn FindEnumStringIndex(cx: *mut JSContext,
|
||||
v: JSVal,
|
||||
values: &[&'static str]) -> Result<Option<uint>, ()> {
|
||||
pub fn find_enum_string_index(cx: *mut JSContext,
|
||||
v: JSVal,
|
||||
values: &[&'static str])
|
||||
-> Result<Option<uint>, ()> {
|
||||
unsafe {
|
||||
let jsstr = JS_ValueToString(cx, v);
|
||||
if jsstr.is_null() {
|
||||
|
@ -488,7 +489,7 @@ pub fn FindEnumStringIndex(cx: *mut JSContext,
|
|||
|
||||
/// Returns wether `obj` is a platform object
|
||||
/// http://heycam.github.io/webidl/#dfn-platform-object
|
||||
pub fn IsPlatformObject(obj: *mut JSObject) -> bool {
|
||||
pub fn is_platform_object(obj: *mut JSObject) -> bool {
|
||||
unsafe {
|
||||
// Fast-path the common case
|
||||
let mut clasp = JS_GetClass(obj);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue