mirror of
https://github.com/servo/servo.git
synced 2025-08-05 05:30:08 +01:00
Move debug functions to Window IDL.
This is a cleaner way to expose those functions, and makes it possible to remove a significant amount code in rust-mozjs. The assert() function is no longer exposed, as it was unused and not very useful.
This commit is contained in:
parent
052d3cb083
commit
30055d9820
4 changed files with 21 additions and 10 deletions
|
@ -23,6 +23,7 @@ use servo_util::str::DOMString;
|
|||
use servo_util::task::{spawn_named};
|
||||
|
||||
use js::jsapi::JSContext;
|
||||
use js::jsapi::{JS_GC, JS_GetRuntime};
|
||||
use js::jsval::{NullValue, JSVal};
|
||||
|
||||
use collections::hashmap::HashMap;
|
||||
|
@ -138,6 +139,8 @@ pub trait WindowMethods {
|
|||
fn Window(&self) -> Temporary<Window>;
|
||||
fn Self(&self) -> Temporary<Window>;
|
||||
fn Performance(&mut self) -> Temporary<Performance>;
|
||||
fn Debug(&self, message: DOMString);
|
||||
fn Gc(&self);
|
||||
}
|
||||
|
||||
impl<'a> WindowMethods for JSRef<'a, Window> {
|
||||
|
@ -263,6 +266,16 @@ impl<'a> WindowMethods for JSRef<'a, Window> {
|
|||
}
|
||||
Temporary::new(self.performance.get_ref().clone())
|
||||
}
|
||||
|
||||
fn Debug(&self, message: DOMString) {
|
||||
debug!("{:s}", message);
|
||||
}
|
||||
|
||||
fn Gc(&self) {
|
||||
unsafe {
|
||||
JS_GC(JS_GetRuntime(self.get_cx()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl Reflectable for Window {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue