mirror of
https://github.com/servo/servo.git
synced 2025-08-04 21:20:23 +01:00
Move Traceable, trace_reflector from utils.rs to trace.rs.(fixes #1748)
This commit is contained in:
parent
98170e67c0
commit
f706123208
3 changed files with 26 additions and 22 deletions
|
@ -30,10 +30,10 @@ use js::jsapi::{JS_GetFunctionPrototype, JS_InternString, JS_GetFunctionObject};
|
|||
use js::jsapi::{JS_HasPropertyById, JS_GetPrototype, JS_GetGlobalForObject};
|
||||
use js::jsapi::{JS_NewUCStringCopyN, JS_DefineFunctions, JS_DefineProperty};
|
||||
use js::jsapi::{JS_ValueToString, JS_GetReservedSlot, JS_SetReservedSlot};
|
||||
use js::jsapi::{JSContext, JSObject, JSBool, jsid, JSClass, JSNative, JSTracer};
|
||||
use js::jsapi::{JSContext, JSObject, JSBool, jsid, JSClass, JSNative};
|
||||
use js::jsapi::{JSFunctionSpec, JSPropertySpec, JSVal, JSPropertyDescriptor};
|
||||
use js::jsapi::{JS_NewGlobalObject, JS_InitStandardClasses};
|
||||
use js::jsapi::{JSString, JS_CallTracer, JSTRACE_OBJECT};
|
||||
use js::jsapi::{JSString};
|
||||
use js::jsapi::{JS_IsExceptionPending, JS_AllowGC, JS_InhibitGC};
|
||||
use js::jsfriendapi::bindgen::JS_NewObjectWithUniqueType;
|
||||
use js::{JSPROP_ENUMERATE, JSVAL_NULL, JSCLASS_IS_GLOBAL, JSCLASS_IS_DOMJSCLASS};
|
||||
|
@ -556,23 +556,6 @@ pub extern fn ThrowingConstructor(_cx: *JSContext, _argc: c_uint, _vp: *mut JSVa
|
|||
return 0;
|
||||
}
|
||||
|
||||
pub trait Traceable {
|
||||
fn trace(&self, trc: *mut JSTracer);
|
||||
}
|
||||
|
||||
pub fn trace_reflector(tracer: *mut JSTracer, description: &str, reflector: &Reflector) {
|
||||
unsafe {
|
||||
description.to_c_str().with_ref(|name| {
|
||||
(*tracer).debugPrinter = ptr::null();
|
||||
(*tracer).debugPrintIndex = -1;
|
||||
(*tracer).debugPrintArg = name as *libc::c_void;
|
||||
debug!("tracing {:s}", description);
|
||||
JS_CallTracer(tracer as *JSTracer, reflector.get_jsobject(),
|
||||
JSTRACE_OBJECT as u32);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
pub fn initialize_global(global: *JSObject) {
|
||||
let protoArray = @mut ([0 as *JSObject, ..PrototypeList::id::_ID_Count as uint]);
|
||||
unsafe {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue