| 19 | } |
| 20 | |
| 21 | void DataViewPrototype::initialize(Realm& realm) |
| 22 | { |
| 23 | auto& vm = this->vm(); |
| 24 | Base::initialize(realm); |
| 25 | u8 attr = Attribute::Writable | Attribute::Configurable; |
| 26 | |
| 27 | define_native_function(realm, vm.names.getBigInt64, get_big_int_64, 1, attr); |
| 28 | define_native_function(realm, vm.names.getBigUint64, get_big_uint_64, 1, attr); |
| 29 | define_native_function(realm, vm.names.getFloat16, get_float_16, 1, attr); |
| 30 | define_native_function(realm, vm.names.getFloat32, get_float_32, 1, attr); |
| 31 | define_native_function(realm, vm.names.getFloat64, get_float_64, 1, attr); |
| 32 | define_native_function(realm, vm.names.getInt8, get_int_8, 1, attr); |
| 33 | define_native_function(realm, vm.names.getInt16, get_int_16, 1, attr); |
| 34 | define_native_function(realm, vm.names.getInt32, get_int_32, 1, attr); |
| 35 | define_native_function(realm, vm.names.getUint8, get_uint_8, 1, attr); |
| 36 | define_native_function(realm, vm.names.getUint16, get_uint_16, 1, attr); |
| 37 | define_native_function(realm, vm.names.getUint32, get_uint_32, 1, attr); |
| 38 | define_native_function(realm, vm.names.setBigInt64, set_big_int_64, 2, attr); |
| 39 | define_native_function(realm, vm.names.setBigUint64, set_big_uint_64, 2, attr); |
| 40 | define_native_function(realm, vm.names.setFloat16, set_float_16, 2, attr); |
| 41 | define_native_function(realm, vm.names.setFloat32, set_float_32, 2, attr); |
| 42 | define_native_function(realm, vm.names.setFloat64, set_float_64, 2, attr); |
| 43 | define_native_function(realm, vm.names.setInt8, set_int_8, 2, attr); |
| 44 | define_native_function(realm, vm.names.setInt16, set_int_16, 2, attr); |
| 45 | define_native_function(realm, vm.names.setInt32, set_int_32, 2, attr); |
| 46 | define_native_function(realm, vm.names.setUint8, set_uint_8, 2, attr); |
| 47 | define_native_function(realm, vm.names.setUint16, set_uint_16, 2, attr); |
| 48 | define_native_function(realm, vm.names.setUint32, set_uint_32, 2, attr); |
| 49 | |
| 50 | define_native_accessor(realm, vm.names.buffer, buffer_getter, {}, Attribute::Configurable); |
| 51 | define_native_accessor(realm, vm.names.byteLength, byte_length_getter, {}, Attribute::Configurable); |
| 52 | define_native_accessor(realm, vm.names.byteOffset, byte_offset_getter, {}, Attribute::Configurable); |
| 53 | |
| 54 | // 25.3.4.27 DataView.prototype [ @@toStringTag ], https://tc39.es/ecma262/#sec-dataview.prototype-@@tostringtag |
| 55 | define_direct_property(vm.well_known_symbol_to_string_tag(), PrimitiveString::create(vm, vm.names.DataView.as_string()), Attribute::Configurable); |
| 56 | } |
| 57 | |
| 58 | // 25.3.1.5 GetViewValue ( view, requestIndex, isLittleEndian, type ), https://tc39.es/ecma262/#sec-getviewvalue |
| 59 | template<typename T> |
nothing calls this directly
no test coverage detected