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

Unified Diff: pkg/dev_compiler/tool/input_sdk/lib/js/dart2js/js_dart2js.dart

Issue 2610813003: Fix DDC cross-window JS interop on FireFox. (Closed)
Patch Set: Created 3 years, 11 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/test/browser/language_tests.js ('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/lib/js/dart2js/js_dart2js.dart
diff --git a/pkg/dev_compiler/tool/input_sdk/lib/js/dart2js/js_dart2js.dart b/pkg/dev_compiler/tool/input_sdk/lib/js/dart2js/js_dart2js.dart
index 3fc25adc692f40fcbae963abe66fc4bdfbca3dbe..ae590ad1f6205d9fd55853ec8c6fe557b0b95b5d 100644
--- a/pkg/dev_compiler/tool/input_sdk/lib/js/dart2js/js_dart2js.dart
+++ b/pkg/dev_compiler/tool/input_sdk/lib/js/dart2js/js_dart2js.dart
@@ -431,7 +431,12 @@ class JsArray<E> extends JsObject with ListMixin<E> {
}
}
+// Cross frame objects should not be considered browser types.
+// We include the the instanceof Object test to filter out cross frame objects
+// on FireFox. Surprisingly on FireFox the instanceof Window test succeeds for
+// cross frame windows while the instanceof Object test fails.
bool _isBrowserType(o) => JS('bool',
+ '# instanceof Object && ('
'# instanceof Blob || '
'# instanceof Event || '
'(window.KeyRange && # instanceof KeyRange) || '
@@ -440,7 +445,7 @@ bool _isBrowserType(o) => JS('bool',
'# instanceof Node || '
// Int8Array.__proto__ is TypedArray.
'(window.Int8Array && # instanceof Int8Array.__proto__) || '
- '# instanceof Window', o, o, o, o, o, o, o, o);
+ '# instanceof Window)', o, o, o, o, o, o, o, o, o);
class _DartObject {
final _dartObj;
« no previous file with comments | « pkg/dev_compiler/test/browser/language_tests.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698