Skip to content

Commit e8dbf13

Browse files
committedJan 26, 2014
dom/event/message: fix #data and #source instanceof checks
1 parent 5150f5a commit e8dbf13

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed
 

‎opal/browser/dom/event/message.rb

+3-3
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,10 @@ def self.construct(name, desc)
3939

4040
def data
4141
%x{
42-
if (#@native.data instanceof ArrayBuffer) {
42+
if (window.ArrayBuffer && #@native.data instanceof ArrayBuffer) {
4343
return #{Buffer.new(`#@native.data`)};
4444
}
45-
else if (#@native.data instanceof Blob) {
45+
else if (window.Blob && #@native.data instanceof Blob) {
4646
return #{Blob.new(`#@native.data`)};
4747
}
4848
else {
@@ -57,7 +57,7 @@ def source
5757
%x{
5858
var source = #@native.source;
5959
60-
if (source instanceof window.Window) {
60+
if (window.Window && source instanceof window.Window) {
6161
return #{Window.new(`source`)};
6262
}
6363
else {

0 commit comments

Comments
 (0)
Please sign in to comment.