@@ -28,7 +28,6 @@ use crate::{
2828use super :: date:: data:: DateHeapData ;
2929use super :: {
3030 control_abstraction_objects:: generator_objects:: GeneratorHeapData ,
31- data_view:: data:: DataViewHeapData ,
3231 error:: ErrorHeapData ,
3332 finalization_registry:: data:: FinalizationRegistryHeapData ,
3433 indexed_collections:: array_objects:: array_iterator_objects:: array_iterator:: ArrayIteratorHeapData ,
@@ -42,11 +41,14 @@ use super::{
4241 regexp:: RegExpHeapData ,
4342 set:: data:: SetHeapData ,
4443 shared_array_buffer:: data:: SharedArrayBufferHeapData ,
45- typed_array:: data:: TypedArrayHeapData ,
4644 weak_map:: data:: WeakMapHeapData ,
4745 weak_ref:: data:: WeakRefHeapData ,
4846 weak_set:: data:: WeakSetHeapData ,
49- ArrayBufferHeapData , ArrayHeapData ,
47+ ArrayHeapData ,
48+ } ;
49+ #[ cfg( feature = "array-buffer" ) ]
50+ use super :: {
51+ data_view:: data:: DataViewHeapData , typed_array:: data:: TypedArrayHeapData , ArrayBufferHeapData ,
5052} ;
5153
5254impl Index < OrdinaryObject > for Agent {
@@ -801,6 +803,7 @@ pub(crate) fn ordinary_object_create_with_intrinsics(
801803
802804 let object = match proto_intrinsics {
803805 ProtoIntrinsics :: Array => agent. heap . create ( ArrayHeapData :: default ( ) ) . into_object ( ) ,
806+ #[ cfg( feature = "array-buffer" ) ]
804807 ProtoIntrinsics :: ArrayBuffer => agent
805808 . heap
806809 . create ( ArrayBufferHeapData :: default ( ) )
@@ -889,23 +892,28 @@ pub(crate) fn ordinary_object_create_with_intrinsics(
889892 . into_object ( ) ,
890893 ProtoIntrinsics :: AsyncFunction => todo ! ( ) ,
891894 ProtoIntrinsics :: AsyncGeneratorFunction => todo ! ( ) ,
895+ #[ cfg( feature = "array-buffer" ) ]
892896 ProtoIntrinsics :: BigInt64Array => agent
893897 . heap
894898 . create ( TypedArrayHeapData :: default ( ) )
895899 . into_object ( ) ,
900+ #[ cfg( feature = "array-buffer" ) ]
896901 ProtoIntrinsics :: BigUint64Array => agent
897902 . heap
898903 . create ( TypedArrayHeapData :: default ( ) )
899904 . into_object ( ) ,
905+ #[ cfg( feature = "array-buffer" ) ]
900906 ProtoIntrinsics :: DataView => agent. heap . create ( DataViewHeapData :: default ( ) ) . into_object ( ) ,
901907 ProtoIntrinsics :: FinalizationRegistry => agent
902908 . heap
903909 . create ( FinalizationRegistryHeapData :: default ( ) )
904910 . into_object ( ) ,
911+ #[ cfg( feature = "array-buffer" ) ]
905912 ProtoIntrinsics :: Float32Array => agent
906913 . heap
907914 . create ( TypedArrayHeapData :: default ( ) )
908915 . into_object ( ) ,
916+ #[ cfg( feature = "array-buffer" ) ]
909917 ProtoIntrinsics :: Float64Array => agent
910918 . heap
911919 . create ( TypedArrayHeapData :: default ( ) )
@@ -915,14 +923,17 @@ pub(crate) fn ordinary_object_create_with_intrinsics(
915923 . create ( GeneratorHeapData :: default ( ) )
916924 . into_object ( ) ,
917925 ProtoIntrinsics :: GeneratorFunction => todo ! ( ) ,
926+ #[ cfg( feature = "array-buffer" ) ]
918927 ProtoIntrinsics :: Int16Array => agent
919928 . heap
920929 . create ( TypedArrayHeapData :: default ( ) )
921930 . into_object ( ) ,
931+ #[ cfg( feature = "array-buffer" ) ]
922932 ProtoIntrinsics :: Int32Array => agent
923933 . heap
924934 . create ( TypedArrayHeapData :: default ( ) )
925935 . into_object ( ) ,
936+ #[ cfg( feature = "array-buffer" ) ]
926937 ProtoIntrinsics :: Int8Array => agent
927938 . heap
928939 . create ( TypedArrayHeapData :: default ( ) )
@@ -943,14 +954,17 @@ pub(crate) fn ordinary_object_create_with_intrinsics(
943954 . heap
944955 . create ( SharedArrayBufferHeapData :: default ( ) )
945956 . into_object ( ) ,
957+ #[ cfg( feature = "array-buffer" ) ]
946958 ProtoIntrinsics :: Uint16Array => agent
947959 . heap
948960 . create ( TypedArrayHeapData :: default ( ) )
949961 . into_object ( ) ,
962+ #[ cfg( feature = "array-buffer" ) ]
950963 ProtoIntrinsics :: Uint32Array => agent
951964 . heap
952965 . create ( TypedArrayHeapData :: default ( ) )
953966 . into_object ( ) ,
967+ #[ cfg( feature = "array-buffer" ) ]
954968 ProtoIntrinsics :: Uint8Array => agent
955969 . heap
956970 . create ( TypedArrayHeapData :: default ( ) )
@@ -1033,15 +1047,19 @@ pub(crate) fn get_prototype_from_constructor(
10331047 ProtoIntrinsics :: AggregateError => Some ( intrinsics. aggregate_error ( ) . into_function ( ) ) ,
10341048 ProtoIntrinsics :: Array => Some ( intrinsics. array ( ) . into_function ( ) ) ,
10351049 ProtoIntrinsics :: ArrayIterator => None ,
1050+ #[ cfg( feature = "array-buffer" ) ]
10361051 ProtoIntrinsics :: ArrayBuffer => Some ( intrinsics. array_buffer ( ) . into_function ( ) ) ,
10371052 ProtoIntrinsics :: AsyncFunction => Some ( intrinsics. async_function ( ) . into_function ( ) ) ,
10381053 ProtoIntrinsics :: AsyncGeneratorFunction => {
10391054 Some ( intrinsics. async_generator_function ( ) . into_function ( ) )
10401055 }
10411056 ProtoIntrinsics :: BigInt => Some ( intrinsics. big_int ( ) . into_function ( ) ) ,
1057+ #[ cfg( feature = "array-buffer" ) ]
10421058 ProtoIntrinsics :: BigInt64Array => Some ( intrinsics. big_int64_array ( ) . into_function ( ) ) ,
1059+ #[ cfg( feature = "array-buffer" ) ]
10431060 ProtoIntrinsics :: BigUint64Array => Some ( intrinsics. big_uint64_array ( ) . into_function ( ) ) ,
10441061 ProtoIntrinsics :: Boolean => Some ( intrinsics. boolean ( ) . into_function ( ) ) ,
1062+ #[ cfg( feature = "array-buffer" ) ]
10451063 ProtoIntrinsics :: DataView => Some ( intrinsics. data_view ( ) . into_function ( ) ) ,
10461064 #[ cfg( feature = "date" ) ]
10471065 ProtoIntrinsics :: Date => Some ( intrinsics. date ( ) . into_function ( ) ) ,
@@ -1050,15 +1068,20 @@ pub(crate) fn get_prototype_from_constructor(
10501068 ProtoIntrinsics :: FinalizationRegistry => {
10511069 Some ( intrinsics. finalization_registry ( ) . into_function ( ) )
10521070 }
1071+ #[ cfg( feature = "array-buffer" ) ]
10531072 ProtoIntrinsics :: Float32Array => Some ( intrinsics. float32_array ( ) . into_function ( ) ) ,
1073+ #[ cfg( feature = "array-buffer" ) ]
10541074 ProtoIntrinsics :: Float64Array => Some ( intrinsics. float64_array ( ) . into_function ( ) ) ,
10551075 ProtoIntrinsics :: Function => Some ( intrinsics. function ( ) . into_function ( ) ) ,
10561076 ProtoIntrinsics :: Generator => None ,
10571077 ProtoIntrinsics :: GeneratorFunction => {
10581078 Some ( intrinsics. generator_function ( ) . into_function ( ) )
10591079 }
1080+ #[ cfg( feature = "array-buffer" ) ]
10601081 ProtoIntrinsics :: Int16Array => Some ( intrinsics. int16_array ( ) . into_function ( ) ) ,
1082+ #[ cfg( feature = "array-buffer" ) ]
10611083 ProtoIntrinsics :: Int32Array => Some ( intrinsics. int32_array ( ) . into_function ( ) ) ,
1084+ #[ cfg( feature = "array-buffer" ) ]
10621085 ProtoIntrinsics :: Int8Array => Some ( intrinsics. int8_array ( ) . into_function ( ) ) ,
10631086 ProtoIntrinsics :: Map => Some ( intrinsics. map ( ) . into_function ( ) ) ,
10641087 ProtoIntrinsics :: MapIterator => None ,
@@ -1077,8 +1100,11 @@ pub(crate) fn get_prototype_from_constructor(
10771100 ProtoIntrinsics :: Symbol => Some ( intrinsics. symbol ( ) . into_function ( ) ) ,
10781101 ProtoIntrinsics :: SyntaxError => Some ( intrinsics. syntax_error ( ) . into_function ( ) ) ,
10791102 ProtoIntrinsics :: TypeError => Some ( intrinsics. type_error ( ) . into_function ( ) ) ,
1103+ #[ cfg( feature = "array-buffer" ) ]
10801104 ProtoIntrinsics :: Uint16Array => Some ( intrinsics. uint16_array ( ) . into_function ( ) ) ,
1105+ #[ cfg( feature = "array-buffer" ) ]
10811106 ProtoIntrinsics :: Uint32Array => Some ( intrinsics. uint32_array ( ) . into_function ( ) ) ,
1107+ #[ cfg( feature = "array-buffer" ) ]
10821108 ProtoIntrinsics :: Uint8Array => Some ( intrinsics. uint8_array ( ) . into_function ( ) ) ,
10831109 ProtoIntrinsics :: UriError => Some ( intrinsics. uri_error ( ) . into_function ( ) ) ,
10841110 ProtoIntrinsics :: WeakMap => Some ( intrinsics. weak_map ( ) . into_function ( ) ) ,
0 commit comments