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

Unified Diff: sdk/lib/_internal/js_runtime/lib/core_patch.dart

Issue 2563633002: Make the VM's dart:core and dart:async library patches clean. (Closed)
Patch Set: Created 4 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
Index: sdk/lib/_internal/js_runtime/lib/core_patch.dart
diff --git a/sdk/lib/_internal/js_runtime/lib/core_patch.dart b/sdk/lib/_internal/js_runtime/lib/core_patch.dart
index c6aa41e5cd9c76249d1a6ec302789925e6563000..2b1ae39227e8c2de659a73f457e3149544c367ae 100644
--- a/sdk/lib/_internal/js_runtime/lib/core_patch.dart
+++ b/sdk/lib/_internal/js_runtime/lib/core_patch.dart
@@ -47,6 +47,9 @@ int identityHashCode(Object object) => objectHashCode(object);
@patch
class Object {
@patch
+ bool operator==(other) => identical(this, other);
+
+ @patch
int get hashCode => Primitives.objectHashCode(this);
@@ -66,6 +69,12 @@ class Object {
Type get runtimeType => getRuntimeType(this);
}
+@patch
+class Null {
+ @patch
+ int get hashCode => super.hashCode;
+}
+
// Patch for Function implementation.
@patch
class Function {
@@ -207,6 +216,33 @@ class Error {
StackTrace get stackTrace => Primitives.extractStackTrace(this);
}
+@patch
+class FallThroughError {
+ @patch
+ String toString() => super.toString();
+}
+
+@patch
+class AbstractClassInstantiationError {
+ @patch
+ String toString() => "Cannot instantiate abstract class: '$_className'";
+}
+
+@patch
+class NoSuchMethodError {
+ @patch
+ NoSuchMethodError(Object receiver,
+ Symbol memberName,
+ List positionalArguments,
+ Map<Symbol, dynamic> namedArguments,
+ [List existingArgumentNames = null])
Lasse Reichstein Nielsen 2016/12/08 12:25:32 This constructor should never have been public. Pr
+ : _receiver = receiver,
+ _memberName = memberName,
+ _arguments = positionalArguments,
+ _namedArguments = namedArguments,
+ _existingArgumentNames = existingArgumentNames;
+}
+
// Patch for DateTime implementation.
@patch
class DateTime {
@@ -461,6 +497,9 @@ class bool {
throw new UnsupportedError(
'bool.fromEnvironment can only be used as a const constructor');
}
+
+ @patch
+ int get hashCode => super.hashCode;
}
@patch

Powered by Google App Engine
This is Rietveld 408576698