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

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

Issue 11414069: Make mappedBy lazy. (Closed) Base URL: https://dart.googlecode.com/svn/experimental/lib_v2/dart
Patch Set: Reupload due to error. Created 8 years, 1 month 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: sdk/lib/_internal/compiler/implementation/lib/core_patch.dart
diff --git a/sdk/lib/_internal/compiler/implementation/lib/core_patch.dart b/sdk/lib/_internal/compiler/implementation/lib/core_patch.dart
index ddea8fc00a2cc6c142a72eb3931457da9a612027..1a7de95758c8a4d58c31fde24534003a8565f58e 100644
--- a/sdk/lib/_internal/compiler/implementation/lib/core_patch.dart
+++ b/sdk/lib/_internal/compiler/implementation/lib/core_patch.dart
@@ -216,38 +216,30 @@ patch class String {
// Patch for String implementation.
patch class Strings {
- patch static String join(List<String> strings, String separator) {
+ patch static String join(Iterable<String> strings, String separator) {
checkNull(strings);
checkNull(separator);
if (separator is !String) throw new ArgumentError(separator);
return stringJoinUnchecked(_toJsStringArray(strings), separator);
}
- patch static String concatAll(List<String> strings) {
+ patch static String concatAll(Iterable<String> strings) {
return stringJoinUnchecked(_toJsStringArray(strings), "");
}
- static List _toJsStringArray(List<String> strings) {
+ static List _toJsStringArray(Iterable<String> strings) {
checkNull(strings);
var array;
+ if (!isJsArray(strings)) {
+ strings = new List.from(string);
+ }
final length = strings.length;
- if (isJsArray(strings)) {
- array = strings;
- for (int i = 0; i < length; i++) {
- final string = strings[i];
- checkNull(string);
- if (string is !String) throw new ArgumentError(string);
- }
- } else {
- array = new List(length);
- for (int i = 0; i < length; i++) {
- final string = strings[i];
- checkNull(string);
- if (string is !String) throw new ArgumentError(string);
- array[i] = string;
- }
+ for (int i = 0; i < length; i++) {
+ final string = strings[i];
+ checkNull(string);
+ if (string is !String) throw new ArgumentError(string);
}
- return array;
+ return strings;
}
}

Powered by Google App Engine
This is Rietveld 408576698