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

Unified Diff: src/ast.h

Issue 1472323002: [es6] Correct parsing of regular expression literal flags. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix oversight in interpreter Created 5 years, 1 month 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 | « src/api.cc ('k') | src/factory.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/ast.h
diff --git a/src/ast.h b/src/ast.h
index e81c02c40a8936b36d6fb91878255a81505cfd73..cb9fb6f5596e49fea53fa1fe102b29b4bda2adc2 100644
--- a/src/ast.h
+++ b/src/ast.h
@@ -1565,12 +1565,11 @@ class RegExpLiteral final : public MaterializedLiteral {
DECLARE_NODE_TYPE(RegExpLiteral)
Handle<String> pattern() const { return pattern_->string(); }
- Handle<String> flags() const { return flags_->string(); }
+ int flags() const { return flags_; }
protected:
- RegExpLiteral(Zone* zone, const AstRawString* pattern,
- const AstRawString* flags, int literal_index, bool is_strong,
- int pos)
+ RegExpLiteral(Zone* zone, const AstRawString* pattern, int flags,
+ int literal_index, bool is_strong, int pos)
: MaterializedLiteral(zone, literal_index, is_strong, pos),
pattern_(pattern),
flags_(flags) {
@@ -1578,8 +1577,8 @@ class RegExpLiteral final : public MaterializedLiteral {
}
private:
- const AstRawString* pattern_;
- const AstRawString* flags_;
+ const AstRawString* const pattern_;
+ int const flags_;
};
@@ -3438,11 +3437,8 @@ class AstNodeFactory final BASE_EMBEDDED {
ast_value_factory_, key, value, is_static, is_computed_name);
}
- RegExpLiteral* NewRegExpLiteral(const AstRawString* pattern,
- const AstRawString* flags,
- int literal_index,
- bool is_strong,
- int pos) {
+ RegExpLiteral* NewRegExpLiteral(const AstRawString* pattern, int flags,
+ int literal_index, bool is_strong, int pos) {
return new (local_zone_) RegExpLiteral(local_zone_, pattern, flags,
literal_index, is_strong, pos);
}
« no previous file with comments | « src/api.cc ('k') | src/factory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698