mirror of
https://github.com/servo/servo.git
synced 2025-08-05 05:30:08 +01:00
Implement WorkerGlobalScope.self.
This commit is contained in:
parent
f403135d9e
commit
1fbf9f7749
2 changed files with 6 additions and 1 deletions
|
@ -5,7 +5,7 @@
|
|||
// http://www.whatwg.org/html/#workerglobalscope
|
||||
//[Exposed=Worker]
|
||||
interface WorkerGlobalScope : EventTarget {
|
||||
//readonly attribute WorkerGlobalScope self;
|
||||
readonly attribute WorkerGlobalScope self;
|
||||
//readonly attribute WorkerLocation location;
|
||||
|
||||
//void close();
|
||||
|
|
|
@ -46,10 +46,15 @@ impl WorkerGlobalScope {
|
|||
}
|
||||
|
||||
pub trait WorkerGlobalScopeMethods {
|
||||
fn Self(&self) -> Temporary<WorkerGlobalScope>;
|
||||
fn Console(&self) -> Temporary<Console>;
|
||||
}
|
||||
|
||||
impl<'a> WorkerGlobalScopeMethods for JSRef<'a, WorkerGlobalScope> {
|
||||
fn Self(&self) -> Temporary<WorkerGlobalScope> {
|
||||
Temporary::from_rooted(self)
|
||||
}
|
||||
|
||||
fn Console(&self) -> Temporary<Console> {
|
||||
if self.console.get().is_none() {
|
||||
let console = Console::new(&global::Worker(*self));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue