Skip to content

Commit

Permalink
dom/event/message: fix #data and #source instanceof checks
Browse files Browse the repository at this point in the history
  • Loading branch information
meh committed Jan 26, 2014
1 parent 5150f5a commit e8dbf13
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions opal/browser/dom/event/message.rb
Expand Up @@ -39,10 +39,10 @@ def self.construct(name, desc)

def data
%x{
if (#@native.data instanceof ArrayBuffer) {
if (window.ArrayBuffer && #@native.data instanceof ArrayBuffer) {
return #{Buffer.new(`#@native.data`)};
}
else if (#@native.data instanceof Blob) {
else if (window.Blob && #@native.data instanceof Blob) {
return #{Blob.new(`#@native.data`)};
}
else {
Expand All @@ -57,7 +57,7 @@ def source
%x{
var source = #@native.source;
if (source instanceof window.Window) {
if (window.Window && source instanceof window.Window) {
return #{Window.new(`source`)};
}
else {
Expand Down

0 comments on commit e8dbf13

Please sign in to comment.