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 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
60 if (scanner->UnescapedLiteralMatches("eval", 4)) | 60 if (scanner->UnescapedLiteralMatches("eval", 4)) |
61 return PreParserIdentifier::Eval(); | 61 return PreParserIdentifier::Eval(); |
62 if (scanner->UnescapedLiteralMatches("arguments", 9)) | 62 if (scanner->UnescapedLiteralMatches("arguments", 9)) |
63 return PreParserIdentifier::Arguments(); | 63 return PreParserIdentifier::Arguments(); |
64 if (scanner->UnescapedLiteralMatches("undefined", 9)) | 64 if (scanner->UnescapedLiteralMatches("undefined", 9)) |
65 return PreParserIdentifier::Undefined(); | 65 return PreParserIdentifier::Undefined(); |
66 if (scanner->LiteralMatches("prototype", 9)) | 66 if (scanner->LiteralMatches("prototype", 9)) |
67 return PreParserIdentifier::Prototype(); | 67 return PreParserIdentifier::Prototype(); |
68 if (scanner->LiteralMatches("constructor", 11)) | 68 if (scanner->LiteralMatches("constructor", 11)) |
69 return PreParserIdentifier::Constructor(); | 69 return PreParserIdentifier::Constructor(); |
| 70 if (scanner->LiteralMatches("name", 4)) |
| 71 return PreParserIdentifier::Name(); |
70 return PreParserIdentifier::Default(); | 72 return PreParserIdentifier::Default(); |
71 } | 73 } |
72 } | 74 } |
73 | 75 |
74 } // unnamed namespace | 76 } // unnamed namespace |
75 | 77 |
76 PreParserIdentifier PreParser::GetSymbol() const { | 78 PreParserIdentifier PreParser::GetSymbol() const { |
77 PreParserIdentifier symbol = GetSymbolHelper(scanner()); | 79 PreParserIdentifier symbol = GetSymbolHelper(scanner()); |
78 if (track_unresolved_variables_) { | 80 if (track_unresolved_variables_) { |
79 const AstRawString* result = scanner()->CurrentSymbol(ast_value_factory()); | 81 const AstRawString* result = scanner()->CurrentSymbol(ast_value_factory()); |
(...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
316 } | 318 } |
317 } | 319 } |
318 } | 320 } |
319 | 321 |
320 #undef CHECK_OK | 322 #undef CHECK_OK |
321 #undef CHECK_OK_CUSTOM | 323 #undef CHECK_OK_CUSTOM |
322 | 324 |
323 | 325 |
324 } // namespace internal | 326 } // namespace internal |
325 } // namespace v8 | 327 } // namespace v8 |
OLD | NEW |