Chromium Code Reviews| 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_; |