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

Unified Diff: pkg/dev_compiler/tool/input_sdk/private/js_helper.dart

Issue 2991353003: Check for cross-frame violation (Closed)
Patch Set: Created 3 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 | « pkg/dev_compiler/lib/sdk/ddc_sdk.sum ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/dev_compiler/tool/input_sdk/private/js_helper.dart
diff --git a/pkg/dev_compiler/tool/input_sdk/private/js_helper.dart b/pkg/dev_compiler/tool/input_sdk/private/js_helper.dart
index cbc52c6f0479931c69aa56f5fe212a002f7bda3a..beffa6545db2207880813fe5d23a5ece8010bdac 100644
--- a/pkg/dev_compiler/tool/input_sdk/private/js_helper.dart
+++ b/pkg/dev_compiler/tool/input_sdk/private/js_helper.dart
@@ -910,7 +910,14 @@ class BooleanConversionAssertionError extends AssertionError {
// Hook to register new global object. This is invoked from dart:html
// whenever a new window is accessed for the first time.
void registerGlobalObject(object) {
- if (dart.polyfill(object)) {
- dart.applyAllExtensions(object);
+ try {
+ if (dart.polyfill(object)) {
+ dart.applyAllExtensions(object);
+ }
+ } catch (e) {
+ // This may fail due to cross-origin errors. In that case, we shouldn't
+ // need to polyfill as we can't get objects from that frame.
+
+ // TODO(vsm): Detect this more robustly - ideally before we try to polyfill.
}
}
« no previous file with comments | « pkg/dev_compiler/lib/sdk/ddc_sdk.sum ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698