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

Unified Diff: sdk/lib/_internal/compiler/implementation/code_buffer.dart

Issue 12300012: Revert "Add StringSink and update StringBuffer." (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 10 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/string_buffer_patch.dart ('k') | sdk/lib/_internal/compiler/implementation/lib/core_patch.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/_internal/compiler/implementation/code_buffer.dart
diff --git a/sdk/lib/_internal/compiler/implementation/code_buffer.dart b/sdk/lib/_internal/compiler/implementation/code_buffer.dart
index 807184c7c38d63c0695c27d4d9887cf066bb63b1..c3465e8783cec69dd3ac6deea2eea9a8d98de952 100644
--- a/sdk/lib/_internal/compiler/implementation/code_buffer.dart
+++ b/sdk/lib/_internal/compiler/implementation/code_buffer.dart
@@ -20,15 +20,11 @@ class CodeBuffer implements StringBuffer {
return buffer.isEmpty;
}
- CodeBuffer add(var object) {
- write(object);
- return this;
- }
/**
* Converts [object] to a string and adds it to the buffer. If [object] is a
* [CodeBuffer], adds its markers to [markers].
*/
- CodeBuffer write(var object) {
+ CodeBuffer add(var object) {
if (object is CodeBuffer) {
return addBuffer(object);
}
@@ -37,10 +33,6 @@ class CodeBuffer implements StringBuffer {
return this;
}
- CodeBuffer writeln(var object) {
- return write(object).write("\n");
- }
-
CodeBuffer addBuffer(CodeBuffer other) {
if (other.markers.length > 0) {
CodeBufferMarker firstMarker = other.markers[0];
@@ -54,20 +46,17 @@ class CodeBuffer implements StringBuffer {
lastBufferOffset = buffer.length + other.lastBufferOffset;
}
buffer.add(other.getText());
- return this;
}
CodeBuffer addAll(Iterable<Object> iterable) {
for (Object obj in iterable) {
- write(obj);
+ add(obj);
}
return this;
}
- CodeBuffer addCharCode(int charCode) => writeCharCode(charCode);
-
- CodeBuffer writeCharCode(int charCode) {
- return write(new String.fromCharCodes([charCode]));
+ CodeBuffer addCharCode(int charCode) {
+ return add(new String.fromCharCodes([charCode]));
}
CodeBuffer clear() {
« no previous file with comments | « runtime/lib/string_buffer_patch.dart ('k') | sdk/lib/_internal/compiler/implementation/lib/core_patch.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698