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

Unified Diff: runtime/lib/string_buffer_patch.dart

Issue 2220883004: Use metadata annotation @patch for patch classes (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
Index: runtime/lib/string_buffer_patch.dart
diff --git a/runtime/lib/string_buffer_patch.dart b/runtime/lib/string_buffer_patch.dart
index 401d258da8eb36db420198e7caa26c2106374b8a..c4fab5c88a9d374f33f6149944f8f833c9bfb1a6 100644
--- a/runtime/lib/string_buffer_patch.dart
+++ b/runtime/lib/string_buffer_patch.dart
@@ -2,7 +2,7 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-patch class StringBuffer {
+@patch class StringBuffer {
static const int _BUFFER_SIZE = 64;
static const int _PARTS_TO_COMPACT = 128;
static const int _PARTS_TO_COMPACT_SIZE_LIMIT = _PARTS_TO_COMPACT * 8;
@@ -48,20 +48,20 @@ patch class StringBuffer {
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 class StringBuffer {
}
}
- /* 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 class StringBuffer {
}
}
- /* 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) ?
"" :

Powered by Google App Engine
This is Rietveld 408576698