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

Side by Side Diff: src/ast.h

Issue 932283003: [strong] make function and class declarations lexical & immutable (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Adjusted assertion Created 5 years, 10 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 unified diff | Download patch
« no previous file with comments | « no previous file | src/parser.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef V8_AST_H_ 5 #ifndef V8_AST_H_
6 #define V8_AST_H_ 6 #define V8_AST_H_
7 7
8 #include "src/v8.h" 8 #include "src/v8.h"
9 9
10 #include "src/assembler.h" 10 #include "src/assembler.h"
(...skipping 559 matching lines...) Expand 10 before | Expand all | Expand 10 after
570 570
571 protected: 571 protected:
572 FunctionDeclaration(Zone* zone, 572 FunctionDeclaration(Zone* zone,
573 VariableProxy* proxy, 573 VariableProxy* proxy,
574 VariableMode mode, 574 VariableMode mode,
575 FunctionLiteral* fun, 575 FunctionLiteral* fun,
576 Scope* scope, 576 Scope* scope,
577 int pos) 577 int pos)
578 : Declaration(zone, proxy, mode, scope, pos), 578 : Declaration(zone, proxy, mode, scope, pos),
579 fun_(fun) { 579 fun_(fun) {
580 // At the moment there are no "const functions" in JavaScript... 580 DCHECK(mode == VAR || mode == LET || mode == CONST);
581 DCHECK(mode == VAR || mode == LET);
582 DCHECK(fun != NULL); 581 DCHECK(fun != NULL);
583 } 582 }
584 583
585 private: 584 private:
586 FunctionLiteral* fun_; 585 FunctionLiteral* fun_;
587 }; 586 };
588 587
589 588
590 class ModuleDeclaration FINAL : public Declaration { 589 class ModuleDeclaration FINAL : public Declaration {
591 public: 590 public:
(...skipping 2899 matching lines...) Expand 10 before | Expand all | Expand 10 after
3491 3490
3492 private: 3491 private:
3493 Zone* zone_; 3492 Zone* zone_;
3494 AstValueFactory* ast_value_factory_; 3493 AstValueFactory* ast_value_factory_;
3495 }; 3494 };
3496 3495
3497 3496
3498 } } // namespace v8::internal 3497 } } // namespace v8::internal
3499 3498
3500 #endif // V8_AST_H_ 3499 #endif // V8_AST_H_
OLDNEW
« no previous file with comments | « no previous file | src/parser.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698