mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-27 18:17:22 +02:00
LibJS: Check for DataView in ArrayBuffer.isView()
This commit is contained in:
committed by
Linus Groh
parent
e992658c12
commit
7a1a91d7f2
Notes:
sideshowbarker
2024-07-18 11:11:22 +09:00
Author: https://github.com/IdanHo Commit: https://github.com/SerenityOS/serenity/commit/7a1a91d7f25 Pull-request: https://github.com/SerenityOS/serenity/pull/8344
@@ -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>
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user