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

Unified Diff: src/parsing/parser.h

Issue 2156303002: Implement new Function.prototype.toString and fix CreateDynamicFunction parsing (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: rebase Created 3 years, 10 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 | « src/parsing/parse-info.cc ('k') | src/parsing/parser.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/parsing/parser.h
diff --git a/src/parsing/parser.h b/src/parsing/parser.h
index a74fda8b61dd655a426a419382498e2b98ccfda8..668f0e7392a7fe64d2d348f6cb84c75918ee3276 100644
--- a/src/parsing/parser.h
+++ b/src/parsing/parser.h
@@ -1121,6 +1121,12 @@ class V8_EXPORT_PRIVATE Parser : public NON_EXPORTED_BASE(ParserBase<Parser>) {
++use_counts_[feature];
}
+ // Returns true iff we're parsing the first function literal during
+ // CreateDynamicFunction().
+ V8_INLINE bool ParsingDynamicFunctionDeclaration() const {
+ return parameters_end_pos_ != kNoSourcePosition;
+ }
+
// Parser's private field members.
friend class DiscardableZoneScope; // Uses reusable_preparser_.
// FIXME(marja): Make reusable_preparser_ always use its own temp Zone (call
@@ -1149,6 +1155,12 @@ class V8_EXPORT_PRIVATE Parser : public NON_EXPORTED_BASE(ParserBase<Parser>) {
ParserLogger* log_;
PreParsedScopeData* preparsed_scope_data_;
+
+ // If not kNoSourcePosition, indicates that the first function literal
+ // encountered is a dynamic function, see CreateDynamicFunction(). This field
+ // indicates the correct position of the ')' that closes the parameter list.
+ // After that ')' is encountered, this field is reset to kNoSourcePosition.
+ int parameters_end_pos_;
};
// ----------------------------------------------------------------------------
« no previous file with comments | « src/parsing/parse-info.cc ('k') | src/parsing/parser.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698