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

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

Issue 10789014: Add CodeBuffer.addAll method. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Address sra's comments. Created 8 years, 5 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/compiler/implementation/code_buffer.dart
diff --git a/lib/compiler/implementation/code_buffer.dart b/lib/compiler/implementation/code_buffer.dart
index a4141c88a860ecc93ced82678524fc89c1979a75..47cca0361fbc85ad2a2873329329c91c4f24fb84 100644
--- a/lib/compiler/implementation/code_buffer.dart
+++ b/lib/compiler/implementation/code_buffer.dart
@@ -11,9 +11,7 @@ class CodeBuffer implements StringBuffer {
: buffer = new StringBuffer(),
sourceLocations = new List<SourceLocation>();
- int get length() {
- return buffer.length;
- }
+ int get length() => buffer.length;
bool isEmpty() {
return buffer.isEmpty();
@@ -47,6 +45,13 @@ class CodeBuffer implements StringBuffer {
buffer.add(other.toString());
}
+ CodeBuffer addAll(Collection<Object> objects) {
+ for (Object obj in objects) {
+ add(obj);
+ }
+ return this;
+ }
+
CodeBuffer addCharCode(int charCode) {
return add(new String.fromCharCodes([charCode]));
}
@@ -78,8 +83,8 @@ class CodeBuffer implements StringBuffer {
}
class SourceLocation {
- Element element;
- Token token;
- int offsetDelta;
+ final Element element;
+ final Token token;
+ final int offsetDelta;
SourceLocation(this.element, this.token, this.offsetDelta);
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698