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

Unified Diff: src/preparser.h

Issue 10270007: Fixed preparser for try statement. Tiny cleanup. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Incorporated review comments Created 8 years, 8 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/preparser.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/preparser.h
diff --git a/src/preparser.h b/src/preparser.h
index f3a43475dfe96bb3d3fd78abfecbf42862883b3c..13261f7a5b945f6b278a5ac9d450557bdce3e168 100644
--- a/src/preparser.h
+++ b/src/preparser.h
@@ -470,8 +470,19 @@ class PreParser {
void set_language_mode(i::LanguageMode language_mode) {
language_mode_ = language_mode;
}
- void EnterWith() { with_nesting_count_++; }
- void LeaveWith() { with_nesting_count_--; }
+
+ class InsideWith {
+ public:
+ explicit InsideWith(Scope* scope) : scope_(scope) {
+ scope->with_nesting_count_++;
+ }
+
+ ~InsideWith() { scope_->with_nesting_count_--; }
+
+ private:
+ Scope* scope_;
+ DISALLOW_COPY_AND_ASSIGN(InsideWith);
+ };
private:
Scope** const variable_;
« no previous file with comments | « no previous file | src/preparser.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698