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

Unified Diff: runtime/vm/scanner.cc

Issue 1925413003: Do not add a private identifier twice into the symbol table, once without the private key appended … (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 8 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/scanner.cc
diff --git a/runtime/vm/scanner.cc b/runtime/vm/scanner.cc
index 9cbe84a220997bba73911bebd9b281cffb478a72..19509b5188b1917121ae9595b91f920ab4c46813 100644
--- a/runtime/vm/scanner.cc
+++ b/runtime/vm/scanner.cc
@@ -329,11 +329,13 @@ void Scanner::ScanIdentChars(bool allow_dollar) {
// We did not read a keyword.
current_token_.kind = Token::kIDENT;
- String& literal =
- String::ZoneHandle(Z, Symbols::New(T, source_, ident_pos, ident_length));
+ String& literal = String::ZoneHandle(Z);
if (ident_char0 == Library::kPrivateIdentifierStart) {
// Private identifiers are mangled on a per library basis.
+ literal = String::SubString(source_, ident_pos, ident_length);
literal = Symbols::FromConcat(T, literal, private_key_);
+ } else {
+ literal = Symbols::New(T, source_, ident_pos, ident_length);
}
current_token_.literal = &literal;
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698