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

Unified Diff: frog/corejs.dart

Issue 8574066: Add a test for "is Object", fix try-catch of null (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: frogsh, status 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 | « no previous file | frog/frogsh » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: frog/corejs.dart
diff --git a/frog/corejs.dart b/frog/corejs.dart
index 3a1df8e7551acbf73a4465a68a9745035b195d72..8f83e22e875a2affc37e9f6929eea23d0a2b4486 100644
--- a/frog/corejs.dart
+++ b/frog/corejs.dart
@@ -243,7 +243,7 @@ Function.prototype.$genStub = function(argsLength, names) {
function $stackTraceOf(e) {
// TODO(jmesserly): we shouldn't be relying on the e.stack property.
// Need to mangle it.
- return e.stack ? e.stack : null;
+ return (e && e.stack) ? e.stack : null;
}""");
}
@@ -281,10 +281,12 @@ function $toDartException(e) {
res = new StackOverflowException();
}
}
- // TODO(jmesserly): setting the stack property is not a long term solution.
- // Also it causes the exception to print as if it were a TypeError or
- // RangeError, instead of using the proper toString.
- res.stack = e.stack;
+ if (res) {
+ // TODO(jmesserly): setting the stack property is not a long term solution.
+ // Also it causes the exception to print as if it were a JS TypeError or
+ // RangeError, instead of using the proper toString.
+ res.stack = e.stack;
+ }
return res;
}""");
}
« no previous file with comments | « no previous file | frog/frogsh » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698