Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(32)

Unified Diff: src/api.h

Issue 137963002: Various API-related simplifications. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: upload trouble Created 6 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/api.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/api.h
diff --git a/src/api.h b/src/api.h
index 6091aa1abb691cbef2b88142e5853039a9fb5386..2a43651ff3f0d2cb1b4574314debd968a538b248 100644
--- a/src/api.h
+++ b/src/api.h
@@ -551,7 +551,8 @@ class HandleScopeImplementer {
inline bool CallDepthIsZero() { return call_depth_ == 0; }
inline void EnterContext(Handle<Context> context);
- inline bool LeaveContext(Handle<Context> context);
+ inline void LeaveContext();
+ inline bool LastEnteredContextWas(Handle<Context> context);
// Returns the last entered context or an empty handle if no
// contexts have been entered.
@@ -643,12 +644,13 @@ void HandleScopeImplementer::EnterContext(Handle<Context> context) {
}
-bool HandleScopeImplementer::LeaveContext(Handle<Context> context) {
- if (entered_contexts_.is_empty()) return false;
- // TODO(dcarney): figure out what's wrong here
- // if (entered_contexts_.last() != *context) return false;
+void HandleScopeImplementer::LeaveContext() {
entered_contexts_.RemoveLast();
- return true;
+}
+
+
+bool HandleScopeImplementer::LastEnteredContextWas(Handle<Context> context) {
+ return !entered_contexts_.is_empty() && entered_contexts_.last() == *context;
}
« no previous file with comments | « no previous file | src/api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698