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

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

Issue 2751423005: Run dartfmt on all files under runtime. (Closed)
Patch Set: Run dartfmt on all files under runtime. 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 class Symbol { 7 @patch
8 @patch const Symbol(String name) 8 class Symbol {
9 : this._name = name; 9 @patch
10 const Symbol(String name) : this._name = name;
10 11
11 @patch toString() => 'Symbol("${getUnmangledName(this)}")'; 12 @patch
13 toString() => 'Symbol("${getUnmangledName(this)}")';
12 14
13 static getUnmangledName(Symbol symbol) { 15 static getUnmangledName(Symbol symbol) {
14 String string = Symbol.getName(symbol); 16 String string = Symbol.getName(symbol);
15 17
16 // Remove closurization hash mark 18 // Remove closurization hash mark
17 // #foo -> foo 19 // #foo -> foo
18 if (string.startsWith('#')) { 20 if (string.startsWith('#')) {
19 string = string.substring(1); 21 string = string.substring(1);
20 } 22 }
21 // get:foo -> foo 23 // get:foo -> foo
(...skipping 25 matching lines...) Expand all
47 if (!skip) { 49 if (!skip) {
48 result.write(char); 50 result.write(char);
49 } 51 }
50 } 52 }
51 if (add_setter_suffix) { 53 if (add_setter_suffix) {
52 result.write('='); 54 result.write('=');
53 } 55 }
54 return result.toString(); 56 return result.toString();
55 } 57 }
56 58
57 @patch int get hashCode { 59 @patch
60 int get hashCode {
58 const arbitraryPrime = 664597; 61 const arbitraryPrime = 664597;
59 return 0x1fffffff & (arbitraryPrime * _name.hashCode); 62 return 0x1fffffff & (arbitraryPrime * _name.hashCode);
60 } 63 }
61 } 64 }
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