From c12e18998e3351a491c39076e51a5eb4af851298 Mon Sep 17 00:00:00 2001 From: Ms2ger Date: Wed, 11 Jun 2014 15:18:04 +0200 Subject: [PATCH] Remove unused InitIds function. --- src/components/script/dom/bindings/utils.rs | 30 ++------------------- 1 file changed, 2 insertions(+), 28 deletions(-) diff --git a/src/components/script/dom/bindings/utils.rs b/src/components/script/dom/bindings/utils.rs index c91169ad9b0..57e7eebcab0 100644 --- a/src/components/script/dom/bindings/utils.rs +++ b/src/components/script/dom/bindings/utils.rs @@ -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 { }*/ } -fn InternJSString(cx: *mut JSContext, chars: *libc::c_char) -> Option { - 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, ()> {