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

Unified Diff: sdk/lib/_internal/compiler/js_lib/core_patch.dart

Issue 781223002: Simplify dart2js StringBuffer constructor to be initializer-only. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: add type to flattenString to improve type inference Created 6 years 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 | sdk/lib/_internal/compiler/js_lib/js_helper.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/_internal/compiler/js_lib/core_patch.dart
diff --git a/sdk/lib/_internal/compiler/js_lib/core_patch.dart b/sdk/lib/_internal/compiler/js_lib/core_patch.dart
index f7d0036f557c7c52a2663b9ec74b5e52be463be8..9f5bf1c562b4bdb01baf7416bbc97039de720deb 100644
--- a/sdk/lib/_internal/compiler/js_lib/core_patch.dart
+++ b/sdk/lib/_internal/compiler/js_lib/core_patch.dart
@@ -363,16 +363,10 @@ bool identical(Object a, Object b) {
@patch
class StringBuffer {
- String _contents = "";
+ String _contents;
@patch
- StringBuffer([Object content = ""]) {
- if (content is String) {
- _contents = content;
- } else {
- write(content);
- }
- }
+ StringBuffer([Object content = ""]) : _contents = '$content';
@patch
int get length => _contents.length;
« no previous file with comments | « no previous file | sdk/lib/_internal/compiler/js_lib/js_helper.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698