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

Side by Side Diff: src/ast.h

Issue 7992005: Block scoped const variables. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Comments, function variable mode, preparser. Created 9 years, 2 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 | Annotate | Revision Log
« no previous file with comments | « src/arm/full-codegen-arm.cc ('k') | src/contexts.h » ('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 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 387 matching lines...) Expand 10 before | Expand all | Expand 10 after
398 class Declaration: public AstNode { 398 class Declaration: public AstNode {
399 public: 399 public:
400 Declaration(VariableProxy* proxy, 400 Declaration(VariableProxy* proxy,
401 VariableMode mode, 401 VariableMode mode,
402 FunctionLiteral* fun, 402 FunctionLiteral* fun,
403 Scope* scope) 403 Scope* scope)
404 : proxy_(proxy), 404 : proxy_(proxy),
405 mode_(mode), 405 mode_(mode),
406 fun_(fun), 406 fun_(fun),
407 scope_(scope) { 407 scope_(scope) {
408 ASSERT(mode == VAR || mode == CONST || mode == LET); 408 ASSERT(mode == VAR ||
409 mode == CONST ||
410 mode == CONST_HARMONY ||
411 mode == LET);
409 // At the moment there are no "const functions"'s in JavaScript... 412 // At the moment there are no "const functions"'s in JavaScript...
410 ASSERT(fun == NULL || mode == VAR || mode == LET); 413 ASSERT(fun == NULL || mode == VAR || mode == LET);
411 } 414 }
412 415
413 DECLARE_NODE_TYPE(Declaration) 416 DECLARE_NODE_TYPE(Declaration)
414 417
415 VariableProxy* proxy() const { return proxy_; } 418 VariableProxy* proxy() const { return proxy_; }
416 VariableMode mode() const { return mode_; } 419 VariableMode mode() const { return mode_; }
417 FunctionLiteral* fun() const { return fun_; } // may be NULL 420 FunctionLiteral* fun() const { return fun_; } // may be NULL
418 virtual bool IsInlineable() const; 421 virtual bool IsInlineable() const;
(...skipping 1701 matching lines...) Expand 10 before | Expand all | Expand 10 after
2120 2123
2121 private: 2124 private:
2122 Isolate* isolate_; 2125 Isolate* isolate_;
2123 bool stack_overflow_; 2126 bool stack_overflow_;
2124 }; 2127 };
2125 2128
2126 2129
2127 } } // namespace v8::internal 2130 } } // namespace v8::internal
2128 2131
2129 #endif // V8_AST_H_ 2132 #endif // V8_AST_H_
OLDNEW
« no previous file with comments | « src/arm/full-codegen-arm.cc ('k') | src/contexts.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698