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

Unified Diff: runtime/vm/object.cc

Issue 1589643002: Source positions for constructors and lots of async machinery (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 11 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
Index: runtime/vm/object.cc
diff --git a/runtime/vm/object.cc b/runtime/vm/object.cc
index 730d5605b16b7a2f2cfa1bd21d8272a3950a61e1..a345676176403bcea18a039a3b0aa18c0801e879 100644
--- a/runtime/vm/object.cc
+++ b/runtime/vm/object.cc
@@ -2694,7 +2694,7 @@ RawFunction* Function::CreateMethodExtractor(const String& getter_name) const {
false, // Not external.
false, // Not native.
owner,
- 0)); // token_pos
+ ClassifyingTokenPositions::kMethodExtractor)); // token_pos
// Initialize signature: receiver is a single fixed parameter.
const intptr_t kNumParameters = 1;
@@ -5787,7 +5787,7 @@ void Function::set_recognized_kind(MethodRecognizer::Kind value) const {
void Function::set_token_pos(intptr_t token_pos) const {
- ASSERT(token_pos >= 0);
+ ASSERT((token_pos >= 0) || IsMethodExtractor());
StoreNonPointer(&raw_ptr()->token_pos_, token_pos);
}
@@ -8547,7 +8547,10 @@ TokenStream::Iterator::Iterator(const TokenStream& tokens,
cur_token_kind_(Token::kILLEGAL),
cur_token_obj_index_(-1),
stream_type_(stream_type) {
- SetCurrentPosition(token_pos);
+ ASSERT(token_pos != Scanner::kNoSourcePos);
+ if (token_pos >= 0) {
+ SetCurrentPosition(token_pos);
+ }
}

Powered by Google App Engine
This is Rietveld 408576698