Introduce an api to query the microtask autorun state of an isolate
authorjochen@chromium.org <jochen@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Mon, 12 May 2014 06:27:38 +0000 (06:27 +0000)
committerjochen@chromium.org <jochen@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Mon, 12 May 2014 06:27:38 +0000 (06:27 +0000)
BUG=none
R=adamk@chromium.org, svenpanne@chromium.org
LOG=y

Review URL: https://codereview.chromium.org/264333004

git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@21250 ce2b1a6d-e550-0410-aec6-3dcde31c8c00

include/v8.h
src/api.cc

index 4839be8..45b107f 100644 (file)
@@ -4393,6 +4393,12 @@ class V8_EXPORT Isolate {
    */
   void SetAutorunMicrotasks(bool autorun);
 
+  /**
+   * Experimental: Returns whether the Microtask Work Queue is automatically
+   * run when the script call depth decrements to zero.
+   */
+  bool WillAutorunMicrotasks() const;
+
  private:
   template<class K, class V, class Traits> friend class PersistentValueMap;
 
index 931549a..8b161bc 100644 (file)
@@ -6659,6 +6659,11 @@ void Isolate::SetAutorunMicrotasks(bool autorun) {
 }
 
 
+bool Isolate::WillAutorunMicrotasks() const {
+  return reinterpret_cast<const i::Isolate*>(this)->autorun_microtasks();
+}
+
+
 String::Utf8Value::Utf8Value(v8::Handle<v8::Value> obj)
     : str_(NULL), length_(0) {
   i::Isolate* isolate = i::Isolate::Current();