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

Unified Diff: pkg/polymer/lib/polymer_element.dart

Issue 23618008: Suppressing exceptions in Dartium's dart:js usage (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 4 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 | sdk/lib/js/dartium/js_dartium.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
« no previous file with comments | « no previous file | sdk/lib/js/dartium/js_dartium.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698