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

Unified Diff: src/preparser.h

Issue 6990056: Add tests for function statements in strict mode. (Closed)
Patch Set: Created 9 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « preparser/preparser-process.cc ('k') | src/preparser.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/preparser.h
diff --git a/src/preparser.h b/src/preparser.h
index 2a2a49a0fb475e13cb3d213893c64b7ef78fe500..2efd53ef87e1f81e8ab48f2dedc8c094d8ffd037 100644
--- a/src/preparser.h
+++ b/src/preparser.h
@@ -240,6 +240,10 @@ class PreParser {
return Statement(kUnknownStatement);
}
+ static Statement FunctionDeclaration() {
+ return Statement(kFunctionDeclaration);
+ }
+
// Creates expression statement from expression.
// Preserves being an unparenthesized string literal, possibly
// "use strict".
@@ -263,11 +267,16 @@ class PreParser {
return code_ == kUseStrictExpressionStatement;
}
+ bool IsFunctionDeclaration() {
+ return code_ == kFunctionDeclaration;
+ }
+
private:
enum Type {
kUnknownStatement,
kStringLiteralExpressionStatement,
- kUseStrictExpressionStatement
+ kUseStrictExpressionStatement,
+ kFunctionDeclaration
};
explicit Statement(Type code) : code_(code) {}
« no previous file with comments | « preparser/preparser-process.cc ('k') | src/preparser.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698