Index: pkg/dev_compiler/tool/input_sdk/patch/core_patch.dart |
diff --git a/pkg/dev_compiler/tool/input_sdk/patch/core_patch.dart b/pkg/dev_compiler/tool/input_sdk/patch/core_patch.dart |
index 71a568bf472f89f10f8c47bc0f985c8a24385e66..73bd6e5819ee2fef4068fdba65cc12fa8a88a4b5 100644 |
--- a/pkg/dev_compiler/tool/input_sdk/patch/core_patch.dart |
+++ b/pkg/dev_compiler/tool/input_sdk/patch/core_patch.dart |
@@ -5,16 +5,18 @@ |
// Patch file for dart:core classes. |
import "dart:_internal" as _symbol_dev; |
import 'dart:_interceptors'; |
-import 'dart:_js_helper' show patch, |
- checkInt, |
- getRuntimeType, |
- jsonEncodeNative, |
- JsLinkedHashMap, |
- JSSyntaxRegExp, |
- Primitives, |
- stringJoinUnchecked, |
- objectHashCode, |
- getTraceFromException; |
+import 'dart:_js_helper' |
+ show |
+ patch, |
+ checkInt, |
+ getRuntimeType, |
+ jsonEncodeNative, |
+ JsLinkedHashMap, |
+ JSSyntaxRegExp, |
+ Primitives, |
+ stringJoinUnchecked, |
+ objectHashCode, |
+ getTraceFromException; |
import 'dart:_foreign_helper' show JS; |
@@ -29,7 +31,7 @@ int identityHashCode(Object object) => objectHashCode(object); |
@patch |
class Object { |
@patch |
- bool operator==(other) => identical(this, other); |
+ bool operator ==(other) => identical(this, other); |
@patch |
int get hashCode => Primitives.objectHashCode(this); |
@@ -39,11 +41,8 @@ class Object { |
@patch |
dynamic noSuchMethod(Invocation invocation) { |
- throw new NoSuchMethodError( |
- this, |
- invocation.memberName, |
- invocation.positionalArguments, |
- invocation.namedArguments); |
+ throw new NoSuchMethodError(this, invocation.memberName, |
+ invocation.positionalArguments, invocation.namedArguments); |
} |
@patch |
@@ -61,9 +60,8 @@ class Null { |
@patch |
class Function { |
@patch |
- static apply(Function f, |
- List positionalArguments, |
- [Map<Symbol, dynamic> namedArguments]) { |
+ static apply(Function f, List positionalArguments, |
+ [Map<Symbol, dynamic> namedArguments]) { |
positionalArguments ??= []; |
// dcall expects the namedArguments as a JS map in the last slot. |
if (namedArguments != null && namedArguments.isNotEmpty) { |
@@ -73,7 +71,8 @@ class Function { |
}); |
positionalArguments = new List.from(positionalArguments)..add(map); |
} |
- return JS('', 'dart.dcall.apply(null, [#].concat(#))', f, positionalArguments); |
+ return JS( |
+ '', 'dart.dcall.apply(null, [#].concat(#))', f, positionalArguments); |
} |
static Map<String, dynamic> _toMangledNames( |
@@ -94,13 +93,13 @@ class Expando<T> { |
Expando([String name]) : this.name = name; |
@patch |
- T operator[](Object object) { |
+ T operator [](Object object) { |
var values = Primitives.getProperty(object, _EXPANDO_PROPERTY_NAME); |
return (values == null) ? null : Primitives.getProperty(values, _getKey()); |
} |
@patch |
- void operator[]=(Object object, T value) { |
+ void operator []=(Object object, T value) { |
var values = Primitives.getProperty(object, _EXPANDO_PROPERTY_NAME); |
if (values == null) { |
values = new Object(); |
@@ -126,9 +125,7 @@ class Expando<T> { |
@patch |
class int { |
@patch |
- static int parse(String source, |
- { int radix, |
- int onError(String source) }) { |
+ static int parse(String source, {int radix, int onError(String source)}) { |
return Primitives.parseInt(source, radix, onError); |
} |
@@ -142,8 +139,7 @@ class int { |
@patch |
class double { |
@patch |
- static double parse(String source, |
- [double onError(String source)]) { |
+ static double parse(String source, [double onError(String source)]) { |
return Primitives.parseDouble(source, onError); |
} |
} |
@@ -184,33 +180,31 @@ class StrongModeError extends Error {} |
class DateTime { |
@patch |
DateTime.fromMillisecondsSinceEpoch(int millisecondsSinceEpoch, |
- {bool isUtc: false}) |
+ {bool isUtc: false}) |
: this._withValue(millisecondsSinceEpoch, isUtc: isUtc); |
@patch |
DateTime.fromMicrosecondsSinceEpoch(int microsecondsSinceEpoch, |
- {bool isUtc: false}) |
+ {bool isUtc: false}) |
: this._withValue( |
- _microsecondInRoundedMilliseconds(microsecondsSinceEpoch), |
- isUtc: isUtc); |
- |
- @patch |
- DateTime._internal(int year, |
- int month, |
- int day, |
- int hour, |
- int minute, |
- int second, |
- int millisecond, |
- int microsecond, |
- bool isUtc) |
- // checkBool is manually inlined here because dart2js doesn't inline it |
- // and [isUtc] is usually a constant. |
+ _microsecondInRoundedMilliseconds(microsecondsSinceEpoch), |
+ isUtc: isUtc); |
+ |
+ @patch |
+ DateTime._internal(int year, int month, int day, int hour, int minute, |
+ int second, int millisecond, int microsecond, bool isUtc) |
+ // checkBool is manually inlined here because dart2js doesn't inline it |
+ // and [isUtc] is usually a constant. |
: this.isUtc = isUtc is bool |
? isUtc |
: throw new ArgumentError.value(isUtc, 'isUtc'), |
_value = checkInt(Primitives.valueFromDecomposedDate( |
- year, month, day, hour, minute, second, |
+ year, |
+ month, |
+ day, |
+ hour, |
+ minute, |
+ second, |
millisecond + _microsecondInRoundedMilliseconds(microsecond), |
isUtc)); |
@@ -227,11 +221,15 @@ class DateTime { |
} |
@patch |
- static int _brokenDownDateToValue( |
- int year, int month, int day, int hour, int minute, int second, |
- int millisecond, int microsecond, bool isUtc) { |
+ static int _brokenDownDateToValue(int year, int month, int day, int hour, |
+ int minute, int second, int millisecond, int microsecond, bool isUtc) { |
return Primitives.valueFromDecomposedDate( |
- year, month, day, hour, minute, second, |
+ year, |
+ month, |
+ day, |
+ hour, |
+ minute, |
+ second, |
millisecond + _microsecondInRoundedMilliseconds(microsecond), |
isUtc); |
} |
@@ -250,14 +248,14 @@ class DateTime { |
@patch |
DateTime add(Duration duration) { |
- return new DateTime._withValue( |
- _value + duration.inMilliseconds, isUtc: isUtc); |
+ return new DateTime._withValue(_value + duration.inMilliseconds, |
+ isUtc: isUtc); |
} |
@patch |
DateTime subtract(Duration duration) { |
- return new DateTime._withValue( |
- _value - duration.inMilliseconds, isUtc: isUtc); |
+ return new DateTime._withValue(_value - duration.inMilliseconds, |
+ isUtc: isUtc); |
} |
@patch |
@@ -299,7 +297,6 @@ class DateTime { |
int get weekday => Primitives.getWeekday(this); |
} |
- |
// Patch for Stopwatch implementation. |
@patch |
class Stopwatch { |
@@ -324,8 +321,9 @@ class List<E> { |
} else { |
// Explicit type test is necessary to guard against JavaScript conversions |
// in unchecked mode. |
- if ((length is !int) || (length < 0)) { |
- throw new ArgumentError("Length must be a non-negative integer: $length"); |
+ if ((length is! int) || (length < 0)) { |
+ throw new ArgumentError( |
+ "Length must be a non-negative integer: $length"); |
} |
list = JSArray.markFixedList(JS('', 'new Array(#)', length)); |
} |
@@ -344,7 +342,7 @@ class List<E> { |
} |
@patch |
- factory List.from(Iterable elements, { bool growable: true }) { |
+ factory List.from(Iterable elements, {bool growable: true}) { |
List<E> list = new List<E>(); |
for (var e in elements) { |
list.add(e); |
@@ -375,7 +373,7 @@ class Map<K, V> { |
class String { |
@patch |
factory String.fromCharCodes(Iterable<int> charCodes, |
- [int start = 0, int end]) { |
+ [int start = 0, int end]) { |
if (charCodes is JSArray) { |
return _stringFromJSArray(charCodes, start, end); |
} |
@@ -397,7 +395,9 @@ class String { |
} |
static String _stringFromJSArray( |
- /*=JSArray<int>*/ list, int start, int endOrNull) { |
+ /*=JSArray<int>*/ list, |
+ int start, |
+ int endOrNull) { |
int len = list.length; |
int end = RangeError.checkValidRange(start, endOrNull, len); |
if (start > 0 || end < len) { |
@@ -413,8 +413,8 @@ class String { |
return Primitives.stringFromNativeUint8List(charCodes, start, end); |
} |
- static String _stringFromIterable(Iterable<int> charCodes, |
- int start, int end) { |
+ static String _stringFromIterable( |
+ Iterable<int> charCodes, int start, int end) { |
if (start < 0) throw new RangeError.range(start, 0, charCodes.length); |
if (end != null && end < start) { |
throw new RangeError.range(end, start, charCodes.length); |
@@ -449,18 +449,16 @@ class bool { |
} |
@patch |
- int get hashCode => super.hashCode; |
+ int get hashCode => super.hashCode; |
} |
@patch |
class RegExp { |
@patch |
factory RegExp(String source, |
- {bool multiLine: false, |
- bool caseSensitive: true}) |
- => new JSSyntaxRegExp(source, |
- multiLine: multiLine, |
- caseSensitive: caseSensitive); |
+ {bool multiLine: false, bool caseSensitive: true}) => |
+ new JSSyntaxRegExp(source, |
+ multiLine: multiLine, caseSensitive: caseSensitive); |
} |
// Patch for 'identical' function. |
@@ -536,11 +534,9 @@ class StringBuffer { |
@patch |
class NoSuchMethodError { |
@patch |
- NoSuchMethodError(Object receiver, |
- Symbol memberName, |
- List positionalArguments, |
- Map<Symbol, dynamic> namedArguments, |
- [List existingArgumentNames = null]) |
+ NoSuchMethodError(Object receiver, Symbol memberName, |
+ List positionalArguments, Map<Symbol, dynamic> namedArguments, |
+ [List existingArgumentNames = null]) |
: _receiver = receiver, |
_memberName = memberName, |
_arguments = positionalArguments, |
@@ -619,10 +615,8 @@ class _Uri { |
* that appear in [canonicalTable], and returns the escaped string. |
*/ |
@patch |
- static String _uriEncode(List<int> canonicalTable, |
- String text, |
- Encoding encoding, |
- bool spaceToPlus) { |
+ static String _uriEncode(List<int> canonicalTable, String text, |
+ Encoding encoding, bool spaceToPlus) { |
if (identical(encoding, UTF8) && _needsNoEncoding.hasMatch(text)) { |
return text; |
} |