OLD | NEW |
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 #include "src/v8.h" | 5 #include "src/v8.h" |
6 | 6 |
7 #include "src/api.h" | 7 #include "src/api.h" |
8 #include "src/ast.h" | 8 #include "src/ast.h" |
9 #include "src/bailout-reason.h" | 9 #include "src/bailout-reason.h" |
10 #include "src/base/platform/platform.h" | 10 #include "src/base/platform/platform.h" |
(...skipping 1132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1143 // function. Setting this avoids prevents ExpressionFromIdentifier() | 1143 // function. Setting this avoids prevents ExpressionFromIdentifier() |
1144 // from creating unresolved variables in already-resolved scopes. | 1144 // from creating unresolved variables in already-resolved scopes. |
1145 parsing_lazy_arrow_parameters_ = true; | 1145 parsing_lazy_arrow_parameters_ = true; |
1146 Expression* expression = ParseExpression(false, &ok); | 1146 Expression* expression = ParseExpression(false, &ok); |
1147 if (ok) { | 1147 if (ok) { |
1148 // Scanning must end at the same position that was recorded | 1148 // Scanning must end at the same position that was recorded |
1149 // previously. If not, parsing has been interrupted due to a | 1149 // previously. If not, parsing has been interrupted due to a |
1150 // stack overflow, at which point the partially parsed arrow | 1150 // stack overflow, at which point the partially parsed arrow |
1151 // function concise body happens to be a valid expression. This | 1151 // function concise body happens to be a valid expression. This |
1152 // is a problem only for arrow functions with single statement | 1152 // is a problem only for arrow functions with single statement |
1153 // bodies, since there is no end token suck as "}" for normal | 1153 // bodies, since there is no end token such as "}" for normal |
1154 // functions. | 1154 // functions. |
1155 if (scanner()->location().end_pos == shared_info->end_position()) { | 1155 if (scanner()->location().end_pos == shared_info->end_position()) { |
1156 // The pre-parser saw an arrow function here, so the full parser | 1156 // The pre-parser saw an arrow function here, so the full parser |
1157 // must produce a FunctionLiteral. | 1157 // must produce a FunctionLiteral. |
1158 DCHECK(expression->IsFunctionLiteral()); | 1158 DCHECK(expression->IsFunctionLiteral()); |
1159 result = expression->AsFunctionLiteral(); | 1159 result = expression->AsFunctionLiteral(); |
1160 } else { | 1160 } else { |
1161 result = NULL; | 1161 result = NULL; |
1162 ok = false; | 1162 ok = false; |
1163 } | 1163 } |
(...skipping 4394 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5558 } else { | 5558 } else { |
5559 const uc16* data = reinterpret_cast<const uc16*>(raw_string->raw_data()); | 5559 const uc16* data = reinterpret_cast<const uc16*>(raw_string->raw_data()); |
5560 running_hash = StringHasher::ComputeRunningHash(running_hash, data, | 5560 running_hash = StringHasher::ComputeRunningHash(running_hash, data, |
5561 raw_string->length()); | 5561 raw_string->length()); |
5562 } | 5562 } |
5563 } | 5563 } |
5564 | 5564 |
5565 return running_hash; | 5565 return running_hash; |
5566 } | 5566 } |
5567 } } // namespace v8::internal | 5567 } } // namespace v8::internal |
OLD | NEW |