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

Side by Side Diff: runtime/lib/symbol_patch.dart

Issue 2767533002: Revert "Fix observatory tests broken by running dartfmt." (Closed)
Patch Set: Created 3 years, 9 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 unified diff | Download patch
« no previous file with comments | « runtime/lib/string_patch.dart ('k') | runtime/lib/timeline.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 import 'dart:core' hide Symbol; 5 import 'dart:core' hide Symbol;
6 6
7 @patch 7 @patch class Symbol {
8 class Symbol { 8 @patch const Symbol(String name)
9 @patch 9 : this._name = name;
10 const Symbol(String name) : this._name = name;
11 10
12 @patch 11 @patch toString() => 'Symbol("${getUnmangledName(this)}")';
13 toString() => 'Symbol("${getUnmangledName(this)}")';
14 12
15 static getUnmangledName(Symbol symbol) { 13 static getUnmangledName(Symbol symbol) {
16 String string = Symbol.getName(symbol); 14 String string = Symbol.getName(symbol);
17 15
18 // Remove closurization hash mark 16 // Remove closurization hash mark
19 // #foo -> foo 17 // #foo -> foo
20 if (string.startsWith('#')) { 18 if (string.startsWith('#')) {
21 string = string.substring(1); 19 string = string.substring(1);
22 } 20 }
23 // get:foo -> foo 21 // get:foo -> foo
(...skipping 25 matching lines...) Expand all
49 if (!skip) { 47 if (!skip) {
50 result.write(char); 48 result.write(char);
51 } 49 }
52 } 50 }
53 if (add_setter_suffix) { 51 if (add_setter_suffix) {
54 result.write('='); 52 result.write('=');
55 } 53 }
56 return result.toString(); 54 return result.toString();
57 } 55 }
58 56
59 @patch 57 @patch int get hashCode {
60 int get hashCode {
61 const arbitraryPrime = 664597; 58 const arbitraryPrime = 664597;
62 return 0x1fffffff & (arbitraryPrime * _name.hashCode); 59 return 0x1fffffff & (arbitraryPrime * _name.hashCode);
63 } 60 }
64 } 61 }
OLDNEW
« no previous file with comments | « runtime/lib/string_patch.dart ('k') | runtime/lib/timeline.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698