Index: src/full-codegen/full-codegen.h |
diff --git a/src/full-codegen/full-codegen.h b/src/full-codegen/full-codegen.h |
index 5642c0fe886fe5785fc1bc06572005a38016b041..0b71bd6a2e0d08b0cc60f3d1637b472b037dbd4e 100644 |
--- a/src/full-codegen/full-codegen.h |
+++ b/src/full-codegen/full-codegen.h |
@@ -211,6 +211,23 @@ class FullCodeGenerator: public AstVisitor { |
} |
}; |
+ // A class literal expression |
+ class NestedClassLiteral : public NestedStatement { |
+ public: |
+ NestedClassLiteral(FullCodeGenerator* codegen, ClassLiteral* lit) |
+ : NestedStatement(codegen), |
+ needs_context_(lit->scope() != nullptr && |
+ lit->scope()->NeedsContext()) {} |
+ |
+ NestedStatement* Exit(int* context_length) override { |
+ if (needs_context_) ++(*context_length); |
+ return previous_; |
+ } |
+ |
+ private: |
+ const bool needs_context_; |
+ }; |
+ |
class DeferredCommands { |
public: |
enum Command { kReturn, kThrow, kBreak, kContinue }; |