Chromium Code Reviews| Index: lib/compiler/implementation/lib/js_helper.dart |
| =================================================================== |
| --- lib/compiler/implementation/lib/js_helper.dart (revision 11430) |
| +++ lib/compiler/implementation/lib/js_helper.dart (working copy) |
| @@ -960,7 +960,10 @@ |
| getRuntimeTypeInfo(target) { |
| if (target === null) return null; |
| - return JS('var', @'#.builtin$typeInfo', target); |
| + var res = JS('var', @'#.builtin$typeInfo', target); |
| + // If the object does not have runtime type information, return an |
| + // empty literal, to avoid null checks. |
| + return res == null ? JS('var', '{}') : res; |
|
kasperl
2012/08/28 09:14:15
I'd prefer () around the comparison. Would it be p
ngeoffray
2012/08/28 10:39:45
I added a TODO to do that once we have lazy static
|
| } |
| /** |