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

Unified Diff: runtime/lib/string_buffer_patch.dart

Issue 2230383003: Implement @patch annotation for patch class members (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: wip Created 4 years, 4 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 | « runtime/lib/stopwatch_patch.dart ('k') | runtime/lib/string_patch.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/lib/string_buffer_patch.dart
diff --git a/runtime/lib/string_buffer_patch.dart b/runtime/lib/string_buffer_patch.dart
index c4fab5c88a9d374f33f6149944f8f833c9bfb1a6..80dddd534d6bb93e5ed2940ecb5f37ba342894d4 100644
--- a/runtime/lib/string_buffer_patch.dart
+++ b/runtime/lib/string_buffer_patch.dart
@@ -48,20 +48,20 @@
int _bufferCodeUnitMagnitude = 0;
/// Creates the string buffer with an initial content.
- /* @patch */ StringBuffer([Object content = ""]) {
+ @patch StringBuffer([Object content = ""]) {
write(content);
}
- /* @patch */ int get length => _partsCodeUnits + _bufferPosition;
+ @patch int get length => _partsCodeUnits + _bufferPosition;
- /* @patch */ void write(Object obj) {
+ @patch void write(Object obj) {
String str = '$obj';
if (str.isEmpty) return;
_consumeBuffer();
_addPart(str);
}
- /* @patch */ void writeCharCode(int charCode) {
+ @patch void writeCharCode(int charCode) {
if (charCode <= 0xFFFF) {
if (charCode < 0) {
throw new RangeError.range(charCode, 0, 0x10FFFF);
@@ -81,7 +81,7 @@
}
}
- /* @patch */ void writeAll(Iterable objects, [String separator = ""]) {
+ @patch void writeAll(Iterable objects, [String separator = ""]) {
Iterator iterator = objects.iterator;
if (!iterator.moveNext()) return;
if (separator.isEmpty) {
@@ -97,19 +97,19 @@
}
}
- /* @patch */ void writeln([Object obj = ""]) {
+ @patch void writeln([Object obj = ""]) {
write(obj);
write("\n");
}
/** Makes the buffer empty. */
- /* @patch */ void clear() {
+ @patch void clear() {
_parts = null;
_partsCodeUnits = _bufferPosition = _bufferCodeUnitMagnitude = 0;
}
/** Returns the contents of buffer as a string. */
- /* @patch */ String toString() {
+ @patch String toString() {
_consumeBuffer();
return (_partsCodeUnits == 0) ?
"" :
« no previous file with comments | « runtime/lib/stopwatch_patch.dart ('k') | runtime/lib/string_patch.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698