Auto merge of #6675 - saneyuki:trap, r=Ms2ger

Implement Window.trap() to trigger a breakpoint trap

Fix #6673

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/6675)
<!-- Reviewable:end -->
This commit is contained in:
bors-servo 2015-07-20 10:20:57 -06:00
commit 20d8c275d7
2 changed files with 6 additions and 1 deletions

View file

@ -126,6 +126,7 @@ partial interface Window {
readonly attribute Console console; readonly attribute Console console;
void debug(DOMString arg); void debug(DOMString arg);
void gc(); void gc();
void trap();
}; };
Window implements OnErrorEventHandlerForWindow; Window implements OnErrorEventHandlerForWindow;

View file

@ -47,7 +47,7 @@ use net_traits::image_cache_task::{ImageCacheChan, ImageCacheTask};
use net_traits::storage_task::{StorageTask, StorageType}; use net_traits::storage_task::{StorageTask, StorageType};
use profile_traits::mem; use profile_traits::mem;
use util::geometry::{self, Au, MAX_RECT}; use util::geometry::{self, Au, MAX_RECT};
use util::opts; use util::{breakpoint, opts};
use util::str::{DOMString,HTML_SPACE_CHARACTERS}; use util::str::{DOMString,HTML_SPACE_CHARACTERS};
use euclid::{Point2D, Rect, Size2D}; use euclid::{Point2D, Rect, Size2D};
@ -482,6 +482,10 @@ impl<'a> WindowMethods for &'a Window {
} }
} }
fn Trap(self) {
breakpoint();
}
fn Btoa(self, btoa: DOMString) -> Fallible<DOMString> { fn Btoa(self, btoa: DOMString) -> Fallible<DOMString> {
base64_btoa(btoa) base64_btoa(btoa)
} }