OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 #include <cmath> | 5 #include <cmath> |
6 | 6 |
7 #include "src/allocation.h" | 7 #include "src/allocation.h" |
8 #include "src/base/logging.h" | 8 #include "src/base/logging.h" |
9 #include "src/conversions-inl.h" | 9 #include "src/conversions-inl.h" |
10 #include "src/conversions.h" | 10 #include "src/conversions.h" |
(...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
246 super_loc.beg_pos != token_loc.beg_pos) { | 246 super_loc.beg_pos != token_loc.beg_pos) { |
247 ReportMessageAt(super_loc, MessageTemplate::kStrongConstructorSuper); | 247 ReportMessageAt(super_loc, MessageTemplate::kStrongConstructorSuper); |
248 *ok = false; | 248 *ok = false; |
249 return; | 249 return; |
250 } | 250 } |
251 } | 251 } |
252 | 252 |
253 if (directive_prologue) { | 253 if (directive_prologue) { |
254 if (statement.IsUseStrictLiteral()) { | 254 if (statement.IsUseStrictLiteral()) { |
255 scope_->SetLanguageMode( | 255 scope_->SetLanguageMode( |
256 static_cast<LanguageMode>(scope_->language_mode() | STRICT_BIT)); | 256 static_cast<LanguageMode>(scope_->language_mode() | STRICT)); |
257 } else if (statement.IsUseStrongLiteral() && allow_strong_mode()) { | 257 } else if (statement.IsUseStrongLiteral() && allow_strong_mode()) { |
258 scope_->SetLanguageMode(static_cast<LanguageMode>( | 258 scope_->SetLanguageMode(static_cast<LanguageMode>( |
259 scope_->language_mode() | STRICT_BIT | STRONG_BIT)); | 259 scope_->language_mode() | STRONG)); |
260 } else if (!statement.IsStringLiteral()) { | 260 } else if (!statement.IsStringLiteral()) { |
261 directive_prologue = false; | 261 directive_prologue = false; |
262 } | 262 } |
263 } | 263 } |
264 | 264 |
265 // If we're allowed to reset to a bookmark, we will do so when we see a long | 265 // If we're allowed to reset to a bookmark, we will do so when we see a long |
266 // and trivial function. | 266 // and trivial function. |
267 // Our current definition of 'long and trivial' is: | 267 // Our current definition of 'long and trivial' is: |
268 // - over 200 statements | 268 // - over 200 statements |
269 // - all starting with an identifier (i.e., no if, for, while, etc.) | 269 // - all starting with an identifier (i.e., no if, for, while, etc.) |
(...skipping 874 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1144 LanguageMode class_language_mode = language_mode(); | 1144 LanguageMode class_language_mode = language_mode(); |
1145 if (is_strong(class_language_mode) && IsUndefined(name)) { | 1145 if (is_strong(class_language_mode) && IsUndefined(name)) { |
1146 ReportMessageAt(class_name_location, MessageTemplate::kStrongUndefined); | 1146 ReportMessageAt(class_name_location, MessageTemplate::kStrongUndefined); |
1147 *ok = false; | 1147 *ok = false; |
1148 return EmptyExpression(); | 1148 return EmptyExpression(); |
1149 } | 1149 } |
1150 | 1150 |
1151 Scope* scope = NewScope(scope_, BLOCK_SCOPE); | 1151 Scope* scope = NewScope(scope_, BLOCK_SCOPE); |
1152 BlockState block_state(&scope_, scope); | 1152 BlockState block_state(&scope_, scope); |
1153 scope_->SetLanguageMode( | 1153 scope_->SetLanguageMode( |
1154 static_cast<LanguageMode>(class_language_mode | STRICT_BIT)); | 1154 static_cast<LanguageMode>(class_language_mode | STRICT)); |
1155 // TODO(marja): Make PreParser use scope names too. | 1155 // TODO(marja): Make PreParser use scope names too. |
1156 // scope_->SetScopeName(name); | 1156 // scope_->SetScopeName(name); |
1157 | 1157 |
1158 bool has_extends = Check(Token::EXTENDS); | 1158 bool has_extends = Check(Token::EXTENDS); |
1159 if (has_extends) { | 1159 if (has_extends) { |
1160 ExpressionClassifier classifier; | 1160 ExpressionClassifier classifier; |
1161 ParseLeftHandSideExpression(&classifier, CHECK_OK); | 1161 ParseLeftHandSideExpression(&classifier, CHECK_OK); |
1162 ValidateExpression(&classifier, CHECK_OK); | 1162 ValidateExpression(&classifier, CHECK_OK); |
1163 } | 1163 } |
1164 | 1164 |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1202 | 1202 |
1203 DCHECK(!spread_pos.IsValid()); | 1203 DCHECK(!spread_pos.IsValid()); |
1204 | 1204 |
1205 return Expression::Default(); | 1205 return Expression::Default(); |
1206 } | 1206 } |
1207 | 1207 |
1208 #undef CHECK_OK | 1208 #undef CHECK_OK |
1209 | 1209 |
1210 | 1210 |
1211 } } // v8::internal | 1211 } } // v8::internal |
OLD | NEW |