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

Side by Side Diff: src/scopes.h

Issue 816913003: Implement ES6 rest parameters (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix typo in ARM port 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 | « src/scopeinfo.cc ('k') | src/x64/code-stubs-x64.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_SCOPES_H_ 5 #ifndef V8_SCOPES_H_
6 #define V8_SCOPES_H_ 6 #define V8_SCOPES_H_
7 7
8 #include "src/ast.h" 8 #include "src/ast.h"
9 #include "src/zone.h" 9 #include "src/zone.h"
10 10
(...skipping 365 matching lines...) Expand 10 before | Expand all | Expand 10 after
376 376
377 int num_parameters() const { return params_.length(); } 377 int num_parameters() const { return params_.length(); }
378 378
379 // A function can have at most one rest parameter. Returns Variable* or NULL. 379 // A function can have at most one rest parameter. Returns Variable* or NULL.
380 Variable* rest_parameter(int* index) const { 380 Variable* rest_parameter(int* index) const {
381 *index = rest_index_; 381 *index = rest_index_;
382 if (rest_index_ < 0) return NULL; 382 if (rest_index_ < 0) return NULL;
383 return rest_parameter_; 383 return rest_parameter_;
384 } 384 }
385 385
386 bool has_rest_parameter() const {
387 return rest_index_ >= 0;
388 }
389
386 bool is_simple_parameter_list() const { 390 bool is_simple_parameter_list() const {
387 DCHECK(is_function_scope()); 391 DCHECK(is_function_scope());
388 if (rest_index_ >= 0) return false; 392 if (rest_index_ >= 0) return false;
389 return true; 393 return true;
390 } 394 }
391 395
392 // The local variable 'arguments' if we need to allocate it; NULL otherwise. 396 // The local variable 'arguments' if we need to allocate it; NULL otherwise.
393 Variable* arguments() const { return arguments_; } 397 Variable* arguments() const { return arguments_; }
394 398
395 // Declarations list. 399 // Declarations list.
(...skipping 307 matching lines...) Expand 10 before | Expand all | Expand 10 after
703 Scope* outer_scope, 707 Scope* outer_scope,
704 Handle<ScopeInfo> scope_info); 708 Handle<ScopeInfo> scope_info);
705 709
706 AstValueFactory* ast_value_factory_; 710 AstValueFactory* ast_value_factory_;
707 Zone* zone_; 711 Zone* zone_;
708 }; 712 };
709 713
710 } } // namespace v8::internal 714 } } // namespace v8::internal
711 715
712 #endif // V8_SCOPES_H_ 716 #endif // V8_SCOPES_H_
OLDNEW
« no previous file with comments | « src/scopeinfo.cc ('k') | src/x64/code-stubs-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698