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

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: 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..70ac8af8282a0dfe852a472869241c92deb61398 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 WithinWith {
Jakob Kummerow 2012/04/30 12:52:32 nit: not sure I like the name... how about InsideW
Sven Panne 2012/04/30 13:02:32 Done.
+ public:
+ explicit WithinWith(Scope* scope): scope_(scope) {
Jakob Kummerow 2012/04/30 12:52:32 nit: space before ':'
Sven Panne 2012/04/30 13:02:32 Done.
+ scope->with_nesting_count_++;
+ }
+
+ ~WithinWith() { scope_->with_nesting_count_--; }
+
+ private:
+ Scope* scope_;
+ DISALLOW_COPY_AND_ASSIGN(WithinWith);
+ };
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