From 988ea995c49d24f83aafe9bab6a1490301c7cfa3 Mon Sep 17 00:00:00 2001 From: "jochen@chromium.org" Date: Mon, 12 May 2014 06:27:38 +0000 Subject: [PATCH] Introduce an api to query the microtask autorun state of an isolate 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 | 6 ++++++ src/api.cc | 5 +++++ 2 files changed, 11 insertions(+) diff --git a/include/v8.h b/include/v8.h index 4839be8..45b107f 100644 --- a/include/v8.h +++ b/include/v8.h @@ -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 friend class PersistentValueMap; diff --git a/src/api.cc b/src/api.cc index 931549a..8b161bc 100644 --- a/src/api.cc +++ b/src/api.cc @@ -6659,6 +6659,11 @@ void Isolate::SetAutorunMicrotasks(bool autorun) { } +bool Isolate::WillAutorunMicrotasks() const { + return reinterpret_cast(this)->autorun_microtasks(); +} + + String::Utf8Value::Utf8Value(v8::Handle obj) : str_(NULL), length_(0) { i::Isolate* isolate = i::Isolate::Current(); -- 2.7.4