LOG=Y
BUG=v8:3606
R=arv@chromium.org, marja@chromium.org
Review URL: https://codereview.chromium.org/
615813004
Patch from Caitlin Potter <caitpotter88@gmail.com>.
Cr-Commit-Position: refs/heads/master@{#24880}
git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@24880
ce2b1a6d-e550-0410-aec6-
3dcde31c8c00
if (scanner->UnescapedLiteralMatches("arguments", 9)) {
return PreParserIdentifier::Arguments();
}
- if (scanner->UnescapedLiteralMatches("prototype", 9)) {
+ if (scanner->LiteralMatches("prototype", 9)) {
return PreParserIdentifier::Prototype();
}
- if (scanner->UnescapedLiteralMatches("constructor", 11)) {
+ if (scanner->LiteralMatches("constructor", 11)) {
return PreParserIdentifier::Constructor();
}
return PreParserIdentifier::Default();
const AstRawString* NextSymbol(AstValueFactory* ast_value_factory);
double DoubleValue();
- bool UnescapedLiteralMatches(const char* data, int length) {
+ bool LiteralMatches(const char* data, int length, bool allow_escapes = true) {
if (is_literal_one_byte() &&
literal_length() == length &&
- !literal_contains_escapes()) {
+ (allow_escapes || !literal_contains_escapes())) {
const char* token =
reinterpret_cast<const char*>(literal_one_byte_string().start());
return !strncmp(token, data, length);
}
return false;
}
+ inline bool UnescapedLiteralMatches(const char* data, int length) {
+ return LiteralMatches(data, length, false);
+ }
+
void IsGetOrSet(bool* is_get, bool* is_set) {
if (is_literal_one_byte() &&
literal_length() == 3 &&
"static get prototype() {}",
"static set prototype(_) {}",
"static *prototype() {}",
+ "static 'prototype'() {}",
+ "static *'prototype'() {}",
+ "static prot\\u006ftype() {}",
+ "static 'prot\\u006ftype'() {}",
+ "static get 'prot\\u006ftype'() {}",
+ "static set 'prot\\u006ftype'(_) {}",
+ "static *'prot\\u006ftype'() {}",
NULL};
static const ParserFlag always_flags[] = {
"get constructor() {}",
"get constructor(_) {}",
"*constructor() {}",
+ "get 'constructor'() {}",
+ "*'constructor'() {}",
+ "get c\\u006fnstructor() {}",
+ "*c\\u006fnstructor() {}",
+ "get 'c\\u006fnstructor'() {}",
+ "get 'c\\u006fnstructor'(_) {}",
+ "*'c\\u006fnstructor'() {}",
NULL};
static const ParserFlag always_flags[] = {