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

Side by Side Diff: src/preparser.cc

Issue 615813004: Allow escape sequences in Constructor/Prototype tokens in PreParserTraits::GetSymbol() (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 2 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
« no previous file with comments | « no previous file | src/scanner.h » ('j') | src/scanner.h » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "include/v8stdint.h" 7 #include "include/v8stdint.h"
8 8
9 #include "src/allocation.h" 9 #include "src/allocation.h"
10 #include "src/base/logging.h" 10 #include "src/base/logging.h"
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
65 if (scanner->current_token() == Token::FUTURE_RESERVED_WORD) { 65 if (scanner->current_token() == Token::FUTURE_RESERVED_WORD) {
66 return PreParserIdentifier::FutureReserved(); 66 return PreParserIdentifier::FutureReserved();
67 } else if (scanner->current_token() == 67 } else if (scanner->current_token() ==
68 Token::FUTURE_STRICT_RESERVED_WORD) { 68 Token::FUTURE_STRICT_RESERVED_WORD) {
69 return PreParserIdentifier::FutureStrictReserved(); 69 return PreParserIdentifier::FutureStrictReserved();
70 } else if (scanner->current_token() == Token::LET) { 70 } else if (scanner->current_token() == Token::LET) {
71 return PreParserIdentifier::Let(); 71 return PreParserIdentifier::Let();
72 } else if (scanner->current_token() == Token::YIELD) { 72 } else if (scanner->current_token() == Token::YIELD) {
73 return PreParserIdentifier::Yield(); 73 return PreParserIdentifier::Yield();
74 } 74 }
75 if (scanner->UnescapedLiteralMatches("eval", 4)) { 75 if (scanner->LiteralMatches("eval", 4)) {
caitp (gmail) 2014/10/01 20:52:18 I'm not sure if this should be used for "eval" and
arv (Not doing code reviews) 2014/10/01 21:00:34 eval and arguments should be the unescaped one.
76 return PreParserIdentifier::Eval(); 76 return PreParserIdentifier::Eval();
77 } 77 }
78 if (scanner->UnescapedLiteralMatches("arguments", 9)) { 78 if (scanner->LiteralMatches("arguments", 9)) {
79 return PreParserIdentifier::Arguments(); 79 return PreParserIdentifier::Arguments();
80 } 80 }
81 if (scanner->UnescapedLiteralMatches("prototype", 9)) { 81 if (scanner->LiteralMatches("prototype", 9)) {
82 return PreParserIdentifier::Prototype(); 82 return PreParserIdentifier::Prototype();
83 } 83 }
84 if (scanner->UnescapedLiteralMatches("constructor", 11)) { 84 if (scanner->LiteralMatches("constructor", 11)) {
85 return PreParserIdentifier::Constructor(); 85 return PreParserIdentifier::Constructor();
86 } 86 }
87 return PreParserIdentifier::Default(); 87 return PreParserIdentifier::Default();
88 } 88 }
89 89
90 90
91 PreParserIdentifier PreParserTraits::GetNumberAsSymbol(Scanner* scanner) { 91 PreParserIdentifier PreParserTraits::GetNumberAsSymbol(Scanner* scanner) {
92 return PreParserIdentifier::Default(); 92 return PreParserIdentifier::Default();
93 } 93 }
94 94
(...skipping 856 matching lines...) Expand 10 before | Expand all | Expand 10 after
951 ParseIdentifier(kAllowEvalOrArguments, CHECK_OK); 951 ParseIdentifier(kAllowEvalOrArguments, CHECK_OK);
952 ParseArguments(ok); 952 ParseArguments(ok);
953 953
954 return Expression::Default(); 954 return Expression::Default();
955 } 955 }
956 956
957 #undef CHECK_OK 957 #undef CHECK_OK
958 958
959 959
960 } } // v8::internal 960 } } // v8::internal
OLDNEW
« no previous file with comments | « no previous file | src/scanner.h » ('j') | src/scanner.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698