Skip to content

Commit

Permalink
LibJS: Check for DataView in ArrayBuffer.isView()
Browse files Browse the repository at this point in the history
  • Loading branch information
IdanHo authored and linusg committed Jul 1, 2021
1 parent e992658 commit 7a1a91d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion Userland/Libraries/LibJS/Runtime/ArrayBufferConstructor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

#include <LibJS/Runtime/ArrayBuffer.h>
#include <LibJS/Runtime/ArrayBufferConstructor.h>
#include <LibJS/Runtime/DataView.h>
#include <LibJS/Runtime/Error.h>
#include <LibJS/Runtime/GlobalObject.h>
#include <LibJS/Runtime/TypedArray.h>
Expand Down Expand Up @@ -70,7 +71,8 @@ JS_DEFINE_NATIVE_FUNCTION(ArrayBufferConstructor::is_view)
return Value(false);
if (arg.as_object().is_typed_array())
return Value(true);
// FIXME: Check for DataView as well
if (is<DataView>(arg.as_object()))
return Value(true);
return Value(false);
}

Expand Down

0 comments on commit 7a1a91d

Please sign in to comment.