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

Side by Side Diff: src/variables.cc

Issue 7616009: Parse harmony let declarations. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Updated tests. Created 9 years, 4 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
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 23 matching lines...) Expand all
34 namespace v8 { 34 namespace v8 {
35 namespace internal { 35 namespace internal {
36 36
37 // ---------------------------------------------------------------------------- 37 // ----------------------------------------------------------------------------
38 // Implementation Variable. 38 // Implementation Variable.
39 39
40 const char* Variable::Mode2String(Mode mode) { 40 const char* Variable::Mode2String(Mode mode) {
41 switch (mode) { 41 switch (mode) {
42 case VAR: return "VAR"; 42 case VAR: return "VAR";
43 case CONST: return "CONST"; 43 case CONST: return "CONST";
44 case LET: return "LET";
44 case DYNAMIC: return "DYNAMIC"; 45 case DYNAMIC: return "DYNAMIC";
45 case DYNAMIC_GLOBAL: return "DYNAMIC_GLOBAL"; 46 case DYNAMIC_GLOBAL: return "DYNAMIC_GLOBAL";
46 case DYNAMIC_LOCAL: return "DYNAMIC_LOCAL"; 47 case DYNAMIC_LOCAL: return "DYNAMIC_LOCAL";
47 case INTERNAL: return "INTERNAL"; 48 case INTERNAL: return "INTERNAL";
48 case TEMPORARY: return "TEMPORARY"; 49 case TEMPORARY: return "TEMPORARY";
49 } 50 }
50 UNREACHABLE(); 51 UNREACHABLE();
51 return NULL; 52 return NULL;
52 } 53 }
53 54
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
99 } 100 }
100 101
101 102
102 bool Variable::is_global() const { 103 bool Variable::is_global() const {
103 // Temporaries are never global, they must always be allocated in the 104 // Temporaries are never global, they must always be allocated in the
104 // activation frame. 105 // activation frame.
105 return mode_ != TEMPORARY && scope_ != NULL && scope_->is_global_scope(); 106 return mode_ != TEMPORARY && scope_ != NULL && scope_->is_global_scope();
106 } 107 }
107 108
108 } } // namespace v8::internal 109 } } // namespace v8::internal
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698