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

Unified Diff: runtime/lib/errors_patch.dart

Issue 2220883004: Use metadata annotation @patch for patch classes (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: wip Created 4 years, 4 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
Index: runtime/lib/errors_patch.dart
diff --git a/runtime/lib/errors_patch.dart b/runtime/lib/errors_patch.dart
index faf342b66a1db9ba2e1dac802b1699d78182c846..2deb7f967fd47fc5022ed3991c4e033cfde25004 100644
--- a/runtime/lib/errors_patch.dart
+++ b/runtime/lib/errors_patch.dart
@@ -5,16 +5,16 @@
import 'dart:_internal' as internal;
import 'dart:convert' show JSON;
-patch class Error {
- /* patch */ static String _objectToString(Object object) {
+@patch class Error {
+ /* @patch */ static String _objectToString(Object object) {
return Object._toString(object);
}
- /* patch */ static String _stringToSafeString(String string) {
+ /* @patch */ static String _stringToSafeString(String string) {
return JSON.encode(string);
}
- /* patch */ StackTrace get stackTrace => _stackTrace;
+ /* @patch */ StackTrace get stackTrace => _stackTrace;
StackTrace _stackTrace;
}
@@ -95,12 +95,12 @@ class _CastError extends Error implements CastError {
final String _errorMsg;
}
-patch class FallThroughError {
+@patch class FallThroughError {
FallThroughError._create(this._url, this._line);
static _throwNew(int case_clause_pos) native "FallThroughError_throwNew";
- /* patch */ String toString() {
+ /* @patch */ String toString() {
return "'$_url': Switch case fall-through at line $_line.";
}
@@ -116,26 +116,26 @@ class _InternalError {
final String _msg;
}
-patch class UnsupportedError {
+@patch class UnsupportedError {
static _throwNew(String msg) {
throw new UnsupportedError(msg);
}
}
-patch class CyclicInitializationError {
+@patch class CyclicInitializationError {
static _throwNew(String variableName) {
throw new CyclicInitializationError(variableName);
}
}
-patch class AbstractClassInstantiationError {
+@patch class AbstractClassInstantiationError {
AbstractClassInstantiationError._create(
this._className, this._url, this._line);
static _throwNew(int case_clause_pos, String className)
native "AbstractClassInstantiationError_throwNew";
- /* patch */ String toString() {
+ /* @patch */ String toString() {
return "Cannot instantiate abstract class $_className: "
"_url '$_url' line $_line";
}
@@ -146,7 +146,7 @@ patch class AbstractClassInstantiationError {
int _line;
}
-patch class NoSuchMethodError {
+@patch class NoSuchMethodError {
// The compiler emits a call to _throwNew when it cannot resolve a static
// method at compile time. The receiver is actually the literal class of the
// unresolved method.
@@ -284,7 +284,7 @@ patch class NoSuchMethodError {
return "$msg\n\n";
}
- /* patch */ String toString() {
+ /* @patch */ String toString() {
StringBuffer actual_buf = new StringBuffer();
int i = 0;
if (_arguments == null) {

Powered by Google App Engine
This is Rietveld 408576698