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

Unified Diff: sdk/lib/js/dartium/js_dartium.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
Index: sdk/lib/js/dartium/js_dartium.dart
diff --git a/sdk/lib/js/dartium/js_dartium.dart b/sdk/lib/js/dartium/js_dartium.dart
index 393320f91ffd8f70fe532342e4164d54a8e452d1..5f9788be1a69898c84a0aef768f68ea395db2428 100644
--- a/sdk/lib/js/dartium/js_dartium.dart
+++ b/sdk/lib/js/dartium/js_dartium.dart
@@ -79,7 +79,13 @@ SendPortSync _jsPortConvert = window.lookupPort('dart-js-convert');
/**
* Returns a proxy to the global JavaScript context for this page.
*/
-JsObject get context => _deserialize(_jsPortSync.callSync([]));
+JsObject get context {
+ var port = _jsPortSync;
+ if (port == null) {
+ return null;
+ }
+ return _deserialize(_jsPortSync.callSync([]));
+}
/**
* Converts a json-like [data] to a JavaScript map or array and return a
« pkg/polymer/lib/polymer_element.dart ('K') | « pkg/polymer/lib/polymer_element.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698