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

Unified Diff: src/preparser.h

Issue 410873004: Fix checks to bit flags of PreParserExpression (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 5 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 | « no previous file | test/mjsunit/regress-3456.js » ('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 1ea2a2284a7b49382ba3f3ec957600c21cb361a2..1c1e1c4520d0e3cad95a6f2cbb3afdec963d02a7 100644
--- a/src/preparser.h
+++ b/src/preparser.h
@@ -676,21 +676,24 @@ class PreParserExpression {
return (code_ & kTypeMask) == kTypeStringLiteral;
}
- bool IsUseStrictLiteral() {
+ bool IsUseStrictLiteral() const {
return (code_ & kUseStrictString) == kUseStrictString;
}
- bool IsThis() { return code_ == kThisExpression; }
+ bool IsThis() const { return (code_ & kThisExpression) == kThisExpression; }
wingo 2014/07/23 12:54:55 Since the kThisExpression et al are just bitflags
Sven Panne 2014/07/23 13:26:05 For consistency, I would leave it as it is. All th
- bool IsThisProperty() { return code_ == kThisPropertyExpression; }
+ bool IsThisProperty() const {
+ return (code_ & kThisPropertyExpression) == kThisPropertyExpression;
+ }
- bool IsProperty() {
- return code_ == kPropertyExpression || code_ == kThisPropertyExpression;
+ bool IsProperty() const {
+ return (code_ & kPropertyExpression) == kPropertyExpression ||
+ (code_ & kThisPropertyExpression) == kThisPropertyExpression;
}
- bool IsCall() { return code_ == kCallExpression; }
+ bool IsCall() const { return (code_ & kCallExpression) == kCallExpression; }
- bool IsValidReferenceExpression() {
+ bool IsValidReferenceExpression() const {
return IsIdentifier() || IsProperty();
}
« no previous file with comments | « no previous file | test/mjsunit/regress-3456.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698