| 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);
|
| }
|
|
|
|
|