Add a check for when the js execution stack is empty

This commit is contained in:
Connor Brewster 2017-12-02 18:18:35 -06:00 committed by Josh Matthews
parent 87475b11d3
commit 43526c80bb
2 changed files with 10 additions and 1 deletions

View file

@ -35,6 +35,12 @@ pub unsafe fn trace(tracer: *mut JSTracer) {
})
}
pub fn is_execution_stack_empty() -> bool {
STACK.with(|stack| {
stack.borrow().is_empty()
})
}
/// RAII struct that pushes and pops entries from the script settings stack.
pub struct AutoEntryScript {
global: DomRoot<GlobalScope>,