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

Unified Diff: frog/lib/corelib.dart

Issue 8746005: Fix a bunch of issues with 'hidden' DOM types. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: removed dead code Created 9 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
« no previous file with comments | « frog/gen.dart ('k') | frog/lib/natives.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: frog/lib/corelib.dart
diff --git a/frog/lib/corelib.dart b/frog/lib/corelib.dart
index e96946b57880220683b55d7eca185a14cae42c8a..8e784c7a285d75b8524dda12a9db78ff78347c83 100644
--- a/frog/lib/corelib.dart
+++ b/frog/lib/corelib.dart
@@ -68,11 +68,14 @@ void print(Object obj) native '''if (typeof console == 'object') {
class AssertError {
final String failedAssertion;
+
+ // TODO(jmesserly): I don't think these should be here. They are properties of
+ // the stack trace
final String url;
final int line;
final int column;
- AssertError(this.failedAssertion, this.url, this.line, this.column);
+ AssertError._internal(this.failedAssertion, this.url, this.line, this.column);
String toString() {
return "Failed assertion: '$failedAssertion' is not true " +
@@ -80,25 +83,26 @@ class AssertError {
}
}
-class TypeError extends AssertError {
+// TODO(jmesserly): fix the strange interaction with JS TypeError, such as
+// toString(). Ideally this would generate to a different JS name but I'm not
+// sure how to force that.
+class TypeError extends AssertError native 'TypeError' {
final String srcType;
final String dstType;
- TypeError(this.srcType, this.dstType) : super(null, null, null, null);
-
- String toString() {
- return "Failed type check: type $srcType is not assignable to type " +
- "$dstType";
- }
+ TypeError._internal(Object src, String dstType) native @'''
+this.srcType = (src == null ? "Null" : src.$typeNameOf());
+this.destType = destType;
sra1 2011/11/30 23:12:49 BUG: dstType vs destType. You should add a test t
Jennifer Messerly 2011/12/01 00:38:07 Good catch! Hopefully we can make this entire meth
+this.toString = function() {
+ return ("Failed type check: type " + this.srcType +
+ " is not assignable to type" + this.dstType);
+}''';
}
class FallThroughError {
-
const FallThroughError();
- String toString() {
- return "Switch case fall-through.";
- }
+ String toString() => "Switch case fall-through.";
}
// Dart core library.
« no previous file with comments | « frog/gen.dart ('k') | frog/lib/natives.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698