Chromium Code Reviews| Index: src/scopes.h |
| diff --git a/src/scopes.h b/src/scopes.h |
| index 4b8fe4997b46a151439be29e70f9d30de261c240..9fa5c47e0c6d1e0de078700c506ee89da9e9d2ea 100644 |
| --- a/src/scopes.h |
| +++ b/src/scopes.h |
| @@ -57,6 +57,23 @@ class DynamicScopePart : public ZoneObject { |
| }; |
| +// Sloppy block-scoped function declarations to var-bind |
| +class SloppyBlockFunctionMap : public ZoneHashMap { |
| + public: |
| + explicit SloppyBlockFunctionMap(Zone* zone); |
| + |
| + virtual ~SloppyBlockFunctionMap(); |
| + |
| + void Declare(const AstRawString* name, DelegateStatement* statement); |
| + |
| + private: |
| + Zone* zone_; |
| +}; |
| + |
| + |
| +typedef ZoneVector<DelegateStatement*> DelegateVector; |
|
adamk
2015/09/17 18:44:36
This typedef shouldn't be at toplevel (the name is
Dan Ehrenberg
2015/09/17 19:06:03
How's the new name, SloppyBlockFunctionMap::Vector
|
| + |
| + |
| // Global invariants after AST construction: Each reference (i.e. identifier) |
| // to a JavaScript variable (including global properties) is represented by a |
| // VariableProxy node. Immediately after AST construction and before variable |
| @@ -544,6 +561,10 @@ class Scope: public ZoneObject { |
| return params_.Contains(variables_.Lookup(name)); |
| } |
| + SloppyBlockFunctionMap* sloppy_block_function_map() { |
| + return &sloppy_block_function_map_; |
| + } |
| + |
| // Error handling. |
| void ReportMessage(int start_position, int end_position, |
| MessageTemplate::Template message, |
| @@ -602,6 +623,9 @@ class Scope: public ZoneObject { |
| // Module descriptor; module scopes only. |
| ModuleDescriptor* module_descriptor_; |
| + // Map of function names to lists of functions defined in sloppy blocks |
| + SloppyBlockFunctionMap sloppy_block_function_map_; |
| + |
| // Illegal redeclaration. |
| Expression* illegal_redecl_; |