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

Unified Diff: runtime/vm/object.cc

Issue 2419013004: Add local variable declaration token position to service protocol (Closed)
Patch Set: test closure variables Created 4 years, 2 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 c9d92c23b8bc7a29475194c4bf5cc9722de0694b..31b1165a060e39fa1742ee23416964b189a74dfc 100644
--- a/runtime/vm/object.cc
+++ b/runtime/vm/object.cc
@@ -14801,6 +14801,21 @@ void ContextScope::SetTokenIndexAt(intptr_t scope_index,
}
+TokenPosition ContextScope::DeclarationTokenIndexAt(
+ intptr_t scope_index) const {
+ return TokenPosition(
+ Smi::Value(VariableDescAddr(scope_index)->declaration_token_pos));
+}
+
+
+void ContextScope::SetDeclarationTokenIndexAt(
+ intptr_t scope_index,
+ TokenPosition declaration_token_pos) const {
+ StoreSmi(&VariableDescAddr(scope_index)->declaration_token_pos,
+ Smi::New(declaration_token_pos.value()));
+}
+
+
RawString* ContextScope::NameAt(intptr_t scope_index) const {
return VariableDescAddr(scope_index)->name;
}

Powered by Google App Engine
This is Rietveld 408576698