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

Unified Diff: lib/compiler/implementation/lib/js_helper.dart

Issue 10445032: Try to fix issue 3190 by making the exception unwrapping code (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 7 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/compiler/implementation/lib/js_helper.dart
diff --git a/lib/compiler/implementation/lib/js_helper.dart b/lib/compiler/implementation/lib/js_helper.dart
index 0598c6e90ed12353928469b2add83293e3ed55ab..ee4718789d38dc3fa7ff0dbb826874c459c86039 100644
--- a/lib/compiler/implementation/lib/js_helper.dart
+++ b/lib/compiler/implementation/lib/js_helper.dart
@@ -772,14 +772,13 @@ unwrapException(ex) {
return JS('Object', @'#.dartException', ex);
} else if (JS('bool', @'# instanceof TypeError', ex)) {
// TODO(ahe): ex.type is Chrome specific.
- var type = JS('String', @'#.type', ex);
- var jsArguments = JS('Object', @'#.arguments', ex);
- var name = jsArguments[0];
+ var type = JS('var', @'#.type', ex);
+ var name = JS('var', @'#.arguments ? #.arguments[0] : ""', ex, ex);
if (type == 'property_not_function' ||
type == 'called_non_callable' ||
type == 'non_object_property_call' ||
type == 'non_object_property_load') {
- if (name !== null && name.startsWith(@'$call$')) {
+ if (name is String && name.startsWith(@'$call$')) {
return new ObjectNotClosureException();
} else {
return new NullPointerException();
@@ -792,8 +791,8 @@ unwrapException(ex) {
}
}
} else if (JS('bool', @'# instanceof RangeError', ex)) {
- var message = JS('String', @'#.message', ex);
- if (message.contains('call stack')) {
+ var message = JS('var', @'#.message', ex);
+ if (message is String && message.contains('call stack')) {
return new StackOverflowException();
}
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698