Index: src/isolate.h |
diff --git a/src/isolate.h b/src/isolate.h |
index 2f0928558a3845ab8e8fc65b30bb7ad41797023f..8eace1268481c1011607548a610c37f1a31625f6 100644 |
--- a/src/isolate.h |
+++ b/src/isolate.h |
@@ -1414,12 +1414,30 @@ class SaveContext BASE_EMBEDDED { |
class AssertNoContextChange BASE_EMBEDDED { |
#ifdef DEBUG |
public: |
- AssertNoContextChange() : |
+ AssertNoContextChange() : context_(Isolate::Current()->context()) { } |
+ ~AssertNoContextChange() { |
+ ASSERT(Isolate::Current()->context() == *context_); |
+ } |
+ |
+ private: |
+ Handle<Context> context_; |
+#else |
+ public: |
+ AssertNoContextChange() { } |
+#endif |
+}; |
+ |
+ |
+// TODO(mstarzinger): Depracate as soon as everything is handlified. |
+class AssertNoContextChangeWithHandleScope BASE_EMBEDDED { |
+#ifdef DEBUG |
+ public: |
+ AssertNoContextChangeWithHandleScope() : |
scope_(Isolate::Current()), |
context_(Isolate::Current()->context(), Isolate::Current()) { |
} |
- ~AssertNoContextChange() { |
+ ~AssertNoContextChangeWithHandleScope() { |
ASSERT(Isolate::Current()->context() == *context_); |
} |
@@ -1428,7 +1446,7 @@ class AssertNoContextChange BASE_EMBEDDED { |
Handle<Context> context_; |
#else |
public: |
- AssertNoContextChange() { } |
+ AssertNoContextChangeWithHandleScope() { } |
#endif |
}; |