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

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

Issue 10939032: Handle null in constructorNameFallback, and update dart2dart status file. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 years, 3 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 | dart/tests/language/language.status » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: dart/lib/compiler/implementation/lib/native_helper.dart
diff --git a/dart/lib/compiler/implementation/lib/native_helper.dart b/dart/lib/compiler/implementation/lib/native_helper.dart
index 0432dfc2ea11e182fcc6ab27fd9366a3391de758..b712204809ba12a534ecabb0a5a5119af916d7ff 100644
--- a/dart/lib/compiler/implementation/lib/native_helper.dart
+++ b/dart/lib/compiler/implementation/lib/native_helper.dart
@@ -63,8 +63,9 @@ String typeNameInIE(obj) {
return name;
}
-String constructorNameFallback(obj) {
- var constructor = JS('var', "#.constructor", obj);
+String constructorNameFallback(object) {
+ if (object === null) return 'Null';
+ var constructor = JS('var', "#.constructor", object);
if (JS('String', "typeof(#)", constructor) === 'function') {
// The constructor isn't null or undefined at this point. Try
// to grab hold of its name.
@@ -81,7 +82,7 @@ String constructorNameFallback(obj) {
return name;
}
}
- String string = JS('String', 'Object.prototype.toString.call(#)', obj);
+ String string = JS('String', 'Object.prototype.toString.call(#)', object);
return JS('String', '#.substring(8, # - 1)', string, string.length);
}
« no previous file with comments | « no previous file | dart/tests/language/language.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698