Chromium Code Reviews| Index: pkg/polymer/lib/polymer_element.dart |
| diff --git a/pkg/polymer/lib/polymer_element.dart b/pkg/polymer/lib/polymer_element.dart |
| index 297625e5a5e76930d97c5508e05c3f3da003fa8b..14d409683a9db6191f8fa12ba1f53f6397ec8a5e 100644 |
| --- a/pkg/polymer/lib/polymer_element.dart |
| +++ b/pkg/polymer/lib/polymer_element.dart |
| @@ -178,15 +178,13 @@ class PolymerElement extends CustomElement with _EventsMixin { |
| // TODO(terry): Need to detect if ShadowCSS.js has been loaded. Under |
| // Dartium this wouldn't exist. However, dart:js isn't robust |
|
blois
2013/08/27 20:29:30
Not sure if there are additional changes I should
|
| // to use to detect in both Dartium and dart2js if Platform is |
| - // defined. Instead in Dartium it throws an exception but in |
| - // dart2js it works enough to know if Platform is defined (just |
| - // can't be used for further derefs). This bug is described |
| + // defined. This bug is described in |
| // https://code.google.com/p/dart/issues/detail?id=12548 |
| // When fixed only use dart:js. This is necessary under |
| // Dartium (no compile) we want to run w/o the JS polyfill. |
| - try { |
| - if (dartJs.context["Platform"] == null) { return; } |
| - } on NoSuchMethodError catch (e) { return; } |
| + if (dartJs.context == null || !dartJs.context.hasProperty('Platform')) { |
| + return; |
|
terry
2013/08/27 23:30:09
Nice to eliminate the try/catch.
|
| + } |
| var platform = js.context["Platform"]; |
| if (platform == null) return; |