mirror of
https://github.com/servo/servo.git
synced 2025-08-03 12:40:06 +01:00
Remove unused InitIds function.
This commit is contained in:
parent
57e8be0c8f
commit
c12e18998e
1 changed files with 2 additions and 28 deletions
|
@ -22,13 +22,13 @@ use std::slice;
|
|||
use std::str;
|
||||
use js::glue::{js_IsObjectProxyClass, js_IsFunctionProxyClass, IsProxyHandlerFamily};
|
||||
use js::glue::{GetGlobalForObjectCrossCompartment, UnwrapObject, GetProxyHandlerExtra};
|
||||
use js::glue::{IsWrapper, RUST_JSID_TO_STRING, RUST_JSID_IS_INT, RUST_INTERNED_STRING_TO_JSID};
|
||||
use js::glue::{IsWrapper, RUST_JSID_TO_STRING, RUST_JSID_IS_INT};
|
||||
use js::glue::{RUST_JSID_IS_STRING, RUST_JSID_TO_INT};
|
||||
use js::jsapi::{JS_AlreadyHasOwnProperty, JS_NewFunction};
|
||||
use js::jsapi::{JS_DefineProperties, JS_ForwardGetPropertyTo};
|
||||
use js::jsapi::{JS_GetClass, JS_LinkConstructorAndPrototype, JS_GetStringCharsAndLength};
|
||||
use js::jsapi::{JS_ObjectIsRegExp, JS_ObjectIsDate, JSHandleObject};
|
||||
use js::jsapi::{JS_InternString, JS_GetFunctionObject};
|
||||
use js::jsapi::JS_GetFunctionObject;
|
||||
use js::jsapi::{JS_HasPropertyById, JS_GetPrototype};
|
||||
use js::jsapi::{JS_GetProperty, JS_HasProperty};
|
||||
use js::jsapi::{JS_DefineFunctions, JS_DefineProperty};
|
||||
|
@ -490,32 +490,6 @@ pub fn GetArrayIndexFromId(_cx: *mut JSContext, id: jsid) -> Option<u32> {
|
|||
}*/
|
||||
}
|
||||
|
||||
fn InternJSString(cx: *mut JSContext, chars: *libc::c_char) -> Option<jsid> {
|
||||
unsafe {
|
||||
let s = JS_InternString(cx, chars);
|
||||
if s.is_not_null() {
|
||||
Some(RUST_INTERNED_STRING_TO_JSID(cx, s))
|
||||
} else {
|
||||
None
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pub fn InitIds(cx: *mut JSContext, specs: &[JSPropertySpec], ids: &mut [jsid]) -> bool {
|
||||
for (i, spec) in specs.iter().enumerate() {
|
||||
if spec.name.is_null() == true {
|
||||
return true;
|
||||
}
|
||||
match InternJSString(cx, spec.name) {
|
||||
Some(id) => ids[i] = id,
|
||||
None => {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
true
|
||||
}
|
||||
|
||||
pub fn FindEnumStringIndex(cx: *mut JSContext,
|
||||
v: JSVal,
|
||||
values: &[&'static str]) -> Result<Option<uint>, ()> {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue