diff options
author | Idan Horowitz <idan.horowitz@gmail.com> | 2021-10-20 01:40:40 +0300 |
---|---|---|
committer | Linus Groh <mail@linusgroh.de> | 2021-10-20 12:27:19 +0100 |
commit | 40eb3a39d41fe0c3242b586da9cf7e4ce2fcbf13 (patch) | |
tree | a2512e65916d2bebcb71c6dd07b11fb1929b17c8 /Userland/Libraries/LibJS/Runtime | |
parent | ca27e5eff56ebdaf7f990296c6429f1b3afaa057 (diff) | |
download | serenity-40eb3a39d41fe0c3242b586da9cf7e4ce2fcbf13.zip |
LibJS: Rename define_native_function => define_old_native_function
This method will eventually be removed once all native functions are
converted to ThrowCompletionOr
Diffstat (limited to 'Userland/Libraries/LibJS/Runtime')
80 files changed, 669 insertions, 669 deletions
diff --git a/Userland/Libraries/LibJS/Runtime/AbstractOperations.cpp b/Userland/Libraries/LibJS/Runtime/AbstractOperations.cpp index 116c41a909..b3fdeb297d 100644 --- a/Userland/Libraries/LibJS/Runtime/AbstractOperations.cpp +++ b/Userland/Libraries/LibJS/Runtime/AbstractOperations.cpp @@ -823,7 +823,7 @@ Object* create_mapped_arguments_object(GlobalObject& global_object, FunctionObje // 1. Let g be MakeArgGetter(name, env). // 2. Let p be MakeArgSetter(name, env). // 3. Perform map.[[DefineOwnProperty]](! ToString(𝔽(index)), PropertyDescriptor { [[Set]]: p, [[Get]]: g, [[Enumerable]]: false, [[Configurable]]: true }). - object->parameter_map().define_native_accessor( + object->parameter_map().define_old_native_accessor( PropertyName { index }, [&environment, name](VM&, GlobalObject& global_object_getter) -> Value { return MUST(environment.get_binding_value(global_object_getter, name, false)); diff --git a/Userland/Libraries/LibJS/Runtime/ArrayBufferConstructor.cpp b/Userland/Libraries/LibJS/Runtime/ArrayBufferConstructor.cpp index 3ed0d1f64b..9fdd6719ab 100644 --- a/Userland/Libraries/LibJS/Runtime/ArrayBufferConstructor.cpp +++ b/Userland/Libraries/LibJS/Runtime/ArrayBufferConstructor.cpp @@ -27,10 +27,10 @@ void ArrayBufferConstructor::initialize(GlobalObject& global_object) define_direct_property(vm.names.prototype, global_object.array_buffer_prototype(), 0); u8 attr = Attribute::Writable | Attribute::Configurable; - define_native_function(vm.names.isView, is_view, 1, attr); + define_old_native_function(vm.names.isView, is_view, 1, attr); // 25.1.5.4 ArrayBuffer.prototype [ @@toStringTag ], https://tc39.es/ecma262/#sec-arraybuffer.prototype-@@tostringtag - define_native_accessor(*vm.well_known_symbol_species(), symbol_species_getter, {}, Attribute::Configurable); + define_old_native_accessor(*vm.well_known_symbol_species(), symbol_species_getter, {}, Attribute::Configurable); define_direct_property(vm.names.length, Value(1), Attribute::Configurable); } diff --git a/Userland/Libraries/LibJS/Runtime/ArrayBufferPrototype.cpp b/Userland/Libraries/LibJS/Runtime/ArrayBufferPrototype.cpp index 329cd4adcd..4f6af6832c 100644 --- a/Userland/Libraries/LibJS/Runtime/ArrayBufferPrototype.cpp +++ b/Userland/Libraries/LibJS/Runtime/ArrayBufferPrototype.cpp @@ -23,8 +23,8 @@ void ArrayBufferPrototype::initialize(GlobalObject& global_object) auto& vm = this->vm(); Object::initialize(global_object); u8 attr = Attribute::Writable | Attribute::Configurable; - define_native_function(vm.names.slice, slice, 2, attr); - define_native_accessor(vm.names.byteLength, byte_length_getter, {}, Attribute::Configurable); + define_old_native_function(vm.names.slice, slice, 2, attr); + define_old_native_accessor(vm.names.byteLength, byte_length_getter, {}, Attribute::Configurable); // 25.1.5.4 ArrayBuffer.prototype [ @@toStringTag ], https://tc39.es/ecma262/#sec-arraybuffer.prototype-@@tostringtag define_direct_property(*vm.well_known_symbol_to_string_tag(), js_string(vm, vm.names.ArrayBuffer.as_string()), Attribute::Configurable); diff --git a/Userland/Libraries/LibJS/Runtime/ArrayConstructor.cpp b/Userland/Libraries/LibJS/Runtime/ArrayConstructor.cpp index f50c2e207e..933b40001e 100644 --- a/Userland/Libraries/LibJS/Runtime/ArrayConstructor.cpp +++ b/Userland/Libraries/LibJS/Runtime/ArrayConstructor.cpp @@ -34,12 +34,12 @@ void ArrayConstructor::initialize(GlobalObject& global_object) define_direct_property(vm.names.prototype, global_object.array_prototype(), 0); u8 attr = Attribute::Writable | Attribute::Configurable; - define_native_function(vm.names.from, from, 1, attr); - define_native_function(vm.names.isArray, is_array, 1, attr); - define_native_function(vm.names.of, of, 0, attr); + define_old_native_function(vm.names.from, from, 1, attr); + define_old_native_function(vm.names.isArray, is_array, 1, attr); + define_old_native_function(vm.names.of, of, 0, attr); // 23.1.2.5 get Array [ @@species ], https://tc39.es/ecma262/#sec-get-array-@@species - define_native_accessor(*vm.well_known_symbol_species(), symbol_species_getter, {}, Attribute::Configurable); + define_old_native_accessor(*vm.well_known_symbol_species(), symbol_species_getter, {}, Attribute::Configurable); define_direct_property(vm.names.length, Value(1), Attribute::Configurable); } diff --git a/Userland/Libraries/LibJS/Runtime/ArrayIteratorPrototype.cpp b/Userland/Libraries/LibJS/Runtime/ArrayIteratorPrototype.cpp index b47b496fa7..e0e6e70e2f 100644 --- a/Userland/Libraries/LibJS/Runtime/ArrayIteratorPrototype.cpp +++ b/Userland/Libraries/LibJS/Runtime/ArrayIteratorPrototype.cpp @@ -24,7 +24,7 @@ void ArrayIteratorPrototype::initialize(GlobalObject& global_object) auto& vm = this->vm(); Object::initialize(global_object); - define_native_function(vm.names.next, next, 0, Attribute::Configurable | Attribute::Writable); + define_old_native_function(vm.names.next, next, 0, Attribute::Configurable | Attribute::Writable); // 23.1.5.2.2 %ArrayIteratorPrototype% [ @@toStringTag ], https://tc39.es/ecma262/#sec-%arrayiteratorprototype%-@@tostringtag define_direct_property(*vm.well_known_symbol_to_string_tag(), js_string(global_object.heap(), "Array Iterator"), Attribute::Configurable); diff --git a/Userland/Libraries/LibJS/Runtime/ArrayPrototype.cpp b/Userland/Libraries/LibJS/Runtime/ArrayPrototype.cpp index 70c34c2b61..797f349bf2 100644 --- a/Userland/Libraries/LibJS/Runtime/ArrayPrototype.cpp +++ b/Userland/Libraries/LibJS/Runtime/ArrayPrototype.cpp @@ -38,42 +38,42 @@ void ArrayPrototype::initialize(GlobalObject& global_object) Array::initialize(global_object); u8 attr = Attribute::Writable | Attribute::Configurable; - define_native_function(vm.names.filter, filter, 1, attr); - define_native_function(vm.names.forEach, for_each, 1, attr); - define_native_function(vm.names.map, map, 1, attr); - define_native_function(vm.names.pop, pop, 0, attr); - define_native_function(vm.names.push, push, 1, attr); - define_native_function(vm.names.shift, shift, 0, attr); - define_native_function(vm.names.toString, to_string, 0, attr); - define_native_function(vm.names.toLocaleString, to_locale_string, 0, attr); - define_native_function(vm.names.unshift, unshift, 1, attr); - define_native_function(vm.names.join, join, 1, attr); - define_native_function(vm.names.concat, concat, 1, attr); - define_native_function(vm.names.slice, slice, 2, attr); - define_native_function(vm.names.indexOf, index_of, 1, attr); - define_native_function(vm.names.reduce, reduce, 1, attr); - define_native_function(vm.names.reduceRight, reduce_right, 1, attr); - define_native_function(vm.names.reverse, reverse, 0, attr); - define_native_function(vm.names.sort, sort, 1, attr); - define_native_function(vm.names.lastIndexOf, last_index_of, 1, attr); - define_native_function(vm.names.includes, includes, 1, attr); - define_native_function(vm.names.find, find, 1, attr); - define_native_function(vm.names.findIndex, find_index, 1, attr); - define_native_function(vm.names.findLast, find_last, 1, attr); - define_native_function(vm.names.findLastIndex, find_last_index, 1, attr); - define_native_function(vm.names.some, some, 1, attr); - define_native_function(vm.names.every, every, 1, attr); - define_native_function(vm.names.splice, splice, 2, attr); - define_native_function(vm.names.fill, fill, 1, attr); - define_native_function(vm.names.values, values, 0, attr); - define_native_function(vm.names.flat, flat, 0, attr); - define_native_function(vm.names.flatMap, flat_map, 1, attr); - define_native_function(vm.names.at, at, 1, attr); - define_native_function(vm.names.keys, keys, 0, attr); - define_native_function(vm.names.entries, entries, 0, attr); - define_native_function(vm.names.copyWithin, copy_within, 2, attr); - - // Use define_direct_property here instead of define_native_function so that + define_old_native_function(vm.names.filter, filter, 1, attr); + define_old_native_function(vm.names.forEach, for_each, 1, attr); + define_old_native_function(vm.names.map, map, 1, attr); + define_old_native_function(vm.names.pop, pop, 0, attr); + define_old_native_function(vm.names.push, push, 1, attr); + define_old_native_function(vm.names.shift, shift, 0, attr); + define_old_native_function(vm.names.toString, to_string, 0, attr); + define_old_native_function(vm.names.toLocaleString, to_locale_string, 0, attr); + define_old_native_function(vm.names.unshift, unshift, 1, attr); + define_old_native_function(vm.names.join, join, 1, attr); + define_old_native_function(vm.names.concat, concat, 1, attr); + define_old_native_function(vm.names.slice, slice, 2, attr); + define_old_native_function(vm.names.indexOf, index_of, 1, attr); + define_old_native_function(vm.names.reduce, reduce, 1, attr); + define_old_native_function(vm.names.reduceRight, reduce_right, 1, attr); + define_old_native_function(vm.names.reverse, reverse, 0, attr); + define_old_native_function(vm.names.sort, sort, 1, attr); + define_old_native_function(vm.names.lastIndexOf, last_index_of, 1, attr); + define_old_native_function(vm.names.includes, includes, 1, attr); + define_old_native_function(vm.names.find, find, 1, attr); + define_old_native_function(vm.names.findIndex, find_index, 1, attr); + define_old_native_function(vm.names.findLast, find_last, 1, attr); + define_old_native_function(vm.names.findLastIndex, find_last_index, 1, attr); + define_old_native_function(vm.names.some, some, 1, attr); + define_old_native_function(vm.names.every, every, 1, attr); + define_old_native_function(vm.names.splice, splice, 2, attr); + define_old_native_function(vm.names.fill, fill, 1, attr); + define_old_native_function(vm.names.values, values, 0, attr); + define_old_native_function(vm.names.flat, flat, 0, attr); + define_old_native_function(vm.names.flatMap, flat_map, 1, attr); + define_old_native_function(vm.names.at, at, 1, attr); + define_old_native_function(vm.names.keys, keys, 0, attr); + define_old_native_function(vm.names.entries, entries, 0, attr); + define_old_native_function(vm.names.copyWithin, copy_within, 2, attr); + + // Use define_direct_property here instead of define_old_native_function so that // Object.is(Array.prototype[Symbol.iterator], Array.prototype.values) // evaluates to true // 23.1.3.33 Array.prototype [ @@iterator ] ( ), https://tc39.es/ecma262/#sec-array.prototype-@@iterator diff --git a/Userland/Libraries/LibJS/Runtime/AtomicsObject.cpp b/Userland/Libraries/LibJS/Runtime/AtomicsObject.cpp index 13f3c06f1e..b1e9451d99 100644 --- a/Userland/Libraries/LibJS/Runtime/AtomicsObject.cpp +++ b/Userland/Libraries/LibJS/Runtime/AtomicsObject.cpp @@ -146,16 +146,16 @@ void AtomicsObject::initialize(GlobalObject& global_object) auto& vm = this->vm(); u8 attr = Attribute::Writable | Attribute::Configurable; - define_native_function(vm.names.add, add, 3, attr); - define_native_function(vm.names.and_, and_, 3, attr); - define_native_function(vm.names.compareExchange, compare_exchange, 4, attr); - define_native_function(vm.names.exchange, exchange, 3, attr); - define_native_function(vm.names.isLockFree, is_lock_free, 1, attr); - define_native_function(vm.names.load, load, 2, attr); - define_native_function(vm.names.or_, or_, 3, attr); - define_native_function(vm.names.store, store, 3, attr); - define_native_function(vm.names.sub, sub, 3, attr); - define_native_function(vm.names.xor_, xor_, 3, attr); + define_old_native_function(vm.names.add, add, 3, attr); + define_old_native_function(vm.names.and_, and_, 3, attr); + define_old_native_function(vm.names.compareExchange, compare_exchange, 4, attr); + define_old_native_function(vm.names.exchange, exchange, 3, attr); + define_old_native_function(vm.names.isLockFree, is_lock_free, 1, attr); + define_old_native_function(vm.names.load, load, 2, attr); + define_old_native_function(vm.names.or_, or_, 3, attr); + define_old_native_function(vm.names.store, store, 3, attr); + define_old_native_function(vm.names.sub, sub, 3, attr); + define_old_native_function(vm.names.xor_, xor_, 3, attr); // 25.4.15 Atomics [ @@toStringTag ], https://tc39.es/ecma262/#sec-atomics-@@tostringtag define_direct_property(*vm.well_known_symbol_to_string_tag(), js_string(global_object.heap(), "Atomics"), Attribute::Configurable); diff --git a/Userland/Libraries/LibJS/Runtime/BigIntConstructor.cpp b/Userland/Libraries/LibJS/Runtime/BigIntConstructor.cpp index cc72c0c518..86a677d98e 100644 --- a/Userland/Libraries/LibJS/Runtime/BigIntConstructor.cpp +++ b/Userland/Libraries/LibJS/Runtime/BigIntConstructor.cpp @@ -29,8 +29,8 @@ void BigIntConstructor::initialize(GlobalObject& global_object) // TODO: Implement these functions below and uncomment this. // u8 attr = Attribute::Writable | Attribute::Configurable; - // define_native_function(vm.names.asIntN, as_int_n, 2, attr); - // define_native_function(vm.names.asUintN, as_uint_n, 2, attr); + // define_old_native_function(vm.names.asIntN, as_int_n, 2, attr); + // define_old_native_function(vm.names.asUintN, as_uint_n, 2, attr); define_direct_property(vm.names.length, Value(1), Attribute::Configurable); } diff --git a/Userland/Libraries/LibJS/Runtime/BigIntPrototype.cpp b/Userland/Libraries/LibJS/Runtime/BigIntPrototype.cpp index 16cbc9d70d..323369ec26 100644 --- a/Userland/Libraries/LibJS/Runtime/BigIntPrototype.cpp +++ b/Userland/Libraries/LibJS/Runtime/BigIntPrototype.cpp @@ -24,9 +24,9 @@ void BigIntPrototype::initialize(GlobalObject& global_object) auto& vm = this->vm(); Object::initialize(global_object); u8 attr = Attribute::Writable | Attribute::Configurable; - define_native_function(vm.names.toString, to_string, 0, attr); - define_native_function(vm.names.toLocaleString, to_locale_string, 0, attr); - define_native_function(vm.names.valueOf, value_of, 0, attr); + define_old_native_function(vm.names.toString, to_string, 0, attr); + define_old_native_function(vm.names.toLocaleString, to_locale_string, 0, attr); + define_old_native_function(vm.names.valueOf, value_of, 0, attr); // 21.2.3.5 BigInt.prototype [ @@toStringTag ], https://tc39.es/ecma262/#sec-bigint.prototype-@@tostringtag define_direct_property(*vm.well_known_symbol_to_string_tag(), js_string(global_object.heap(), vm.names.BigInt.as_string()), Attribute::Configurable); diff --git a/Userland/Libraries/LibJS/Runtime/BooleanPrototype.cpp b/Userland/Libraries/LibJS/Runtime/BooleanPrototype.cpp index e25beb3fef..21af8ada91 100644 --- a/Userland/Libraries/LibJS/Runtime/BooleanPrototype.cpp +++ b/Userland/Libraries/LibJS/Runtime/BooleanPrototype.cpp @@ -22,8 +22,8 @@ void BooleanPrototype::initialize(GlobalObject& global_object) auto& vm = this->vm(); BooleanObject::initialize(global_object); u8 attr = Attribute::Writable | Attribute::Configurable; - define_native_function(vm.names.toString, to_string, 0, attr); - define_native_function(vm.names.valueOf, value_of, 0, attr); + define_old_native_function(vm.names.toString, to_string, 0, attr); + define_old_native_function(vm.names.valueOf, value_of, 0, attr); } BooleanPrototype::~BooleanPrototype() diff --git a/Userland/Libraries/LibJS/Runtime/ConsoleObject.cpp b/Userland/Libraries/LibJS/Runtime/ConsoleObject.cpp index f486f35290..739802f00e 100644 --- a/Userland/Libraries/LibJS/Runtime/ConsoleObject.cpp +++ b/Userland/Libraries/LibJS/Runtime/ConsoleObject.cpp @@ -22,16 +22,16 @@ void ConsoleObject::initialize(GlobalObject& global_object) auto& vm = this->vm(); Object::initialize(global_object); u8 attr = Attribute::Writable | Attribute::Enumerable | Attribute::Configurable; - define_native_function(vm.names.log, log, 0, attr); - define_native_function(vm.names.debug, debug, 0, attr); - define_native_function(vm.names.info, info, 0, attr); - define_native_function(vm.names.warn, warn, 0, attr); - define_native_function(vm.names.error, error, 0, attr); - define_native_function(vm.names.trace, trace, 0, attr); - define_native_function(vm.names.count, count, 0, attr); - define_native_function(vm.names.countReset, count_reset, 0, attr); - define_native_function(vm.names.clear, clear, 0, attr); - define_native_function(vm.names.assert, assert_, 0, attr); + define_old_native_function(vm.names.log, log, 0, attr); + define_old_native_function(vm.names.debug, debug, 0, attr); + define_old_native_function(vm.names.info, info, 0, attr); + define_old_native_function(vm.names.warn, warn, 0, attr); + define_old_native_function(vm.names.error, error, 0, attr); + define_old_native_function(vm.names.trace, trace, 0, attr); + define_old_native_function(vm.names.count, count, 0, attr); + define_old_native_function(vm.names.countReset, count_reset, 0, attr); + define_old_native_function(vm.names.clear, clear, 0, attr); + define_old_native_function(vm.names.assert, assert_, 0, attr); } ConsoleObject::~ConsoleObject() diff --git a/Userland/Libraries/LibJS/Runtime/DataViewPrototype.cpp b/Userland/Libraries/LibJS/Runtime/DataViewPrototype.cpp index 2a925e260b..edf28b010a 100644 --- a/Userland/Libraries/LibJS/Runtime/DataViewPrototype.cpp +++ b/Userland/Libraries/LibJS/Runtime/DataViewPrototype.cpp @@ -21,30 +21,30 @@ void DataViewPrototype::initialize(GlobalObject& global_object) Object::initialize(global_object); u8 attr = Attribute::Writable | Attribute::Configurable; - define_native_function(vm.names.getBigInt64, get_big_int_64, 1, attr); - define_native_function(vm.names.getBigUint64, get_big_uint_64, 1, attr); - define_native_function(vm.names.getFloat32, get_float_32, 1, attr); - define_native_function(vm.names.getFloat64, get_float_64, 1, attr); - define_native_function(vm.names.getInt8, get_int_8, 1, attr); - define_native_function(vm.names.getInt16, get_int_16, 1, attr); - define_native_function(vm.names.getInt32, get_int_32, 1, attr); - define_native_function(vm.names.getUint8, get_uint_8, 1, attr); - define_native_function(vm.names.getUint16, get_uint_16, 1, attr); - define_native_function(vm.names.getUint32, get_uint_32, 1, attr); - define_native_function(vm.names.setBigInt64, set_big_int_64, 2, attr); - define_native_function(vm.names.setBigUint64, set_big_uint_64, 2, attr); - define_native_function(vm.names.setFloat32, set_float_32, 2, attr); - define_native_function(vm.names.setFloat64, set_float_64, 2, attr); - define_native_function(vm.names.setInt8, set_int_8, 2, attr); - define_native_function(vm.names.setInt16, set_int_16, 2, attr); - define_native_function(vm.names.setInt32, set_int_32, 2, attr); - define_native_function(vm.names.setUint8, set_uint_8, 2, attr); - define_native_function(vm.names.setUint16, set_uint_16, 2, attr); - define_native_function(vm.names.setUint32, set_uint_32, 2, attr); - - define_native_accessor(vm.names.buffer, buffer_getter, {}, Attribute::Configurable); - define_native_accessor(vm.names.byteLength, byte_length_getter, {}, Attribute::Configurable); - define_native_accessor(vm.names.byteOffset, byte_offset_getter, {}, Attribute::Configurable); + define_old_native_function(vm.names.getBigInt64, get_big_int_64, 1, attr); + define_old_native_function(vm.names.getBigUint64, get_big_uint_64, 1, attr); + define_old_native_function(vm.names.getFloat32, get_float_32, 1, attr); + define_old_native_function(vm.names.getFloat64, get_float_64, 1, attr); + define_old_native_function(vm.names.getInt8, get_int_8, 1, attr); + define_old_native_function(vm.names.getInt16, get_int_16, 1, attr); + define_old_native_function(vm.names.getInt32, get_int_32, 1, attr); + define_old_native_function(vm.names.getUint8, get_uint_8, 1, attr); + define_old_native_function(vm.names.getUint16, get_uint_16, 1, attr); + define_old_native_function(vm.names.getUint32, get_uint_32, 1, attr); + define_old_native_function(vm.names.setBigInt64, set_big_int_64, 2, attr); + define_old_native_function(vm.names.setBigUint64, set_big_uint_64, 2, attr); + define_old_native_function(vm.names.setFloat32, set_float_32, 2, attr); + define_old_native_function(vm.names.setFloat64, set_float_64, 2, attr); + define_old_native_function(vm.names.setInt8, set_int_8, 2, attr); + define_old_native_function(vm.names.setInt16, set_int_16, 2, attr); + define_old_native_function(vm.names.setInt32, set_int_32, 2, attr); + define_old_native_function(vm.names.setUint8, set_uint_8, 2, attr); + define_old_native_function(vm.names.setUint16, set_uint_16, 2, attr); + define_old_native_function(vm.names.setUint32, set_uint_32, 2, attr); + + define_old_native_accessor(vm.names.buffer, buffer_getter, {}, Attribute::Configurable); + define_old_native_accessor(vm.names.byteLength, byte_length_getter, {}, Attribute::Configurable); + define_old_native_accessor(vm.names.byteOffset, byte_offset_getter, {}, Attribute::Configurable); // 25.3.4.25 DataView.prototype [ @@toStringTag ], https://tc39.es/ecma262/#sec-dataview.prototype-@@tostringtag define_direct_property(*vm.well_known_symbol_to_string_tag(), js_string(global_object.heap(), vm.names.DataView.as_string()), Attribute::Configurable); diff --git a/Userland/Libraries/LibJS/Runtime/DateConstructor.cpp b/Userland/Libraries/LibJS/Runtime/DateConstructor.cpp index 64078224c4..57d5726f72 100644 --- a/Userland/Libraries/LibJS/Runtime/DateConstructor.cpp +++ b/Userland/Libraries/LibJS/Runtime/DateConstructor.cpp @@ -154,9 +154,9 @@ void DateConstructor::initialize(GlobalObject& global_object) define_direct_property(vm.names.prototype, global_object.date_prototype(), 0); u8 attr = Attribute::Writable | Attribute::Configurable; - define_native_function(vm.names.now, now, 0, attr); - define_native_function(vm.names.parse, parse, 1, attr); - define_native_function(vm.names.UTC, utc, 1, attr); + define_old_native_function(vm.names.now, now, 0, attr); + define_old_native_function(vm.names.parse, parse, 1, attr); + define_old_native_function(vm.names.UTC, utc, 1, attr); define_direct_property(vm.names.length, Value(7), Attribute::Configurable); } diff --git a/Userland/Libraries/LibJS/Runtime/DatePrototype.cpp b/Userland/Libraries/LibJS/Runtime/DatePrototype.cpp index 417192ed47..51f3070515 100644 --- a/Userland/Libraries/LibJS/Runtime/DatePrototype.cpp +++ b/Userland/Libraries/LibJS/Runtime/DatePrototype.cpp @@ -30,57 +30,57 @@ void DatePrototype::initialize(GlobalObject& global_object) auto& vm = this->vm(); Object::initialize(global_object); u8 attr = Attribute::Writable | Attribute::Configurable; - define_native_function(vm.names.getDate, get_date, 0, attr); - define_native_function(vm.names.setDate, set_date, 1, attr); - define_native_function(vm.names.getDay, get_day, 0, attr); - define_native_function(vm.names.getFullYear, get_full_year, 0, attr); - define_native_function(vm.names.setFullYear, set_full_year, 3, attr); - define_native_function(vm.names.getYear, get_year, 0, attr); - define_native_function(vm.names.setYear, set_year, 1, attr); - define_native_function(vm.names.getHours, get_hours, 0, attr); - define_native_function(vm.names.setHours, set_hours, 4, attr); - define_native_function(vm.names.getMilliseconds, get_milliseconds, 0, attr); - define_native_function(vm.names.setMilliseconds, set_milliseconds, 1, attr); - define_native_function(vm.names.getMinutes, get_minutes, 0, attr); - define_native_function(vm.names.setMinutes, set_minutes, 3, attr); - define_native_function(vm.names.getMonth, get_month, 0, attr); - define_native_function(vm.names.setMonth, set_month, 2, attr); - define_native_function(vm.names.getSeconds, get_seconds, 0, attr); - define_native_function(vm.names.setSeconds, set_seconds, 2, attr); - define_native_function(vm.names.getTime, get_time, 0, attr); - define_native_function(vm.names.setTime, set_time, 1, attr); - define_native_function(vm.names.getTimezoneOffset, get_timezone_offset, 0, attr); - define_native_function(vm.names.getUTCDate, get_utc_date, 0, attr); - define_native_function(vm.names.setUTCDate, set_date, 1, attr); // FIXME: This is a hack, Serenity doesn't currently support timezones other than UTC. - define_native_function(vm.names.getUTCDay, get_utc_day, 0, attr); - define_native_function(vm.names.getUTCFullYear, get_utc_full_year, 0, attr); - define_native_function(vm.names.setUTCFullYear, set_full_year, 3, attr); // FIXME: see above - define_native_function(vm.names.getUTCHours, get_utc_hours, 0, attr); - define_native_function(vm.names.setUTCHours, set_hours, 4, attr); // FIXME: see above - define_native_function(vm.names.getUTCMilliseconds, get_utc_milliseconds, 0, attr); - define_native_function(vm.names.setUTCMilliseconds, set_milliseconds, 1, attr); // FIXME: see above - define_native_function(vm.names.getUTCMinutes, get_utc_minutes, 0, attr); - define_native_function(vm.names.setUTCMinutes, set_minutes, 3, attr); // FIXME: see above - define_native_function(vm.names.getUTCMonth, get_utc_month, 0, attr); - define_native_function(vm.names.setUTCMonth, set_month, 2, attr); // FIXME: see above - define_native_function(vm.names.getUTCSeconds, get_utc_seconds, 0, attr); - define_native_function(vm.names.setUTCSeconds, set_seconds, 2, attr); // FIXME: see above - define_native_function(vm.names.toDateString, to_date_string, 0, attr); - define_native_function(vm.names.toUTCString, to_utc_string, 0, attr); - define_native_function(vm.names.toISOString, to_iso_string, 0, attr); - define_native_function(vm.names.toLocaleDateString, to_locale_date_string, 0, attr); - define_native_function(vm.names.toLocaleString, to_locale_string, 0, attr); - define_native_function(vm.names.toLocaleTimeString, to_locale_time_string, 0, attr); - define_native_function(vm.names.toTimeString, to_time_string, 0, attr); - define_native_function(vm.names.toString, to_string, 0, attr); - define_native_function(vm.names.toJSON, to_json, 1, attr); - define_native_function(vm.names.toTemporalInstant, to_temporal_instant, 0, attr); + define_old_native_function(vm.names.getDate, get_date, 0, attr); + define_old_native_function(vm.names.setDate, set_date, 1, attr); + define_old_native_function(vm.names.getDay, get_day, 0, attr); + define_old_native_function(vm.names.getFullYear, get_full_year, 0, attr); + define_old_native_function(vm.names.setFullYear, set_full_year, 3, attr); + define_old_native_function(vm.names.getYear, get_year, 0, attr); + define_old_native_function(vm.names.setYear, set_year, 1, attr); + define_old_native_function(vm.names.getHours, get_hours, 0, attr); + define_old_native_function(vm.names.setHours, set_hours, 4, attr); + define_old_native_function(vm.names.getMilliseconds, get_milliseconds, 0, attr); + define_old_native_function(vm.names.setMilliseconds, set_milliseconds, 1, attr); + define_old_native_function(vm.names.getMinutes, get_minutes, 0, attr); + define_old_native_function(vm.names.setMinutes, set_minutes, 3, attr); + define_old_native_function(vm.names.getMonth, get_month, 0, attr); + define_old_native_function(vm.names.setMonth, set_month, 2, attr); + define_old_native_function(vm.names.getSeconds, get_seconds, 0, attr); + define_old_native_function(vm.names.setSeconds, set_seconds, 2, attr); + define_old_native_function(vm.names.getTime, get_time, 0, attr); + define_old_native_function(vm.names.setTime, set_time, 1, attr); + define_old_native_function(vm.names.getTimezoneOffset, get_timezone_offset, 0, attr); + define_old_native_function(vm.names.getUTCDate, get_utc_date, 0, attr); + define_old_native_function(vm.names.setUTCDate, set_date, 1, attr); // FIXME: This is a hack, Serenity doesn't currently support timezones other than UTC. + define_old_native_function(vm.names.getUTCDay, get_utc_day, 0, attr); + define_old_native_function(vm.names.getUTCFullYear, get_utc_full_year, 0, attr); + define_old_native_function(vm.names.setUTCFullYear, set_full_year, 3, attr); // FIXME: see above + define_old_native_function(vm.names.getUTCHours, get_utc_hours, 0, attr); + define_old_native_function(vm.names.setUTCHours, set_hours, 4, attr); // FIXME: see above + define_old_native_function(vm.names.getUTCMilliseconds, get_utc_milliseconds, 0, attr); + define_old_native_function(vm.names.setUTCMilliseconds, set_milliseconds, 1, attr); // FIXME: see above + define_old_native_function(vm.names.getUTCMinutes, get_utc_minutes, 0, attr); + define_old_native_function(vm.names.setUTCMinutes, set_minutes, 3, attr); // FIXME: see above + define_old_native_function(vm.names.getUTCMonth, get_utc_month, 0, attr); + define_old_native_function(vm.names.setUTCMonth, set_month, 2, attr); // FIXME: see above + define_old_native_function(vm.names.getUTCSeconds, get_utc_seconds, 0, attr); + define_old_native_function(vm.names.setUTCSeconds, set_seconds, 2, attr); // FIXME: see above + define_old_native_function(vm.names.toDateString, to_date_string, 0, attr); + define_old_native_function(vm.names.toUTCString, to_utc_string, 0, attr); + define_old_native_function(vm.names.toISOString, to_iso_string, 0, attr); + define_old_native_function(vm.names.toLocaleDateString, to_locale_date_string, 0, attr); + define_old_native_function(vm.names.toLocaleString, to_locale_string, 0, attr); + define_old_native_function(vm.names.toLocaleTimeString, to_locale_time_string, 0, attr); + define_old_native_function(vm.names.toTimeString, to_time_string, 0, attr); + define_old_native_function(vm.names.toString, to_string, 0, attr); + define_old_native_function(vm.names.toJSON, to_json, 1, attr); + define_old_native_function(vm.names.toTemporalInstant, to_temporal_instant, 0, attr); // 21.4.4.45 Date.prototype [ @@toPrimitive ] ( hint ), https://tc39.es/ecma262/#sec-date.prototype-@@toprimitive - define_native_function(*vm.well_known_symbol_to_primitive(), symbol_to_primitive, 1, Attribute::Configurable); + define_old_native_function(*vm.well_known_symbol_to_primitive(), symbol_to_primitive, 1, Attribute::Configurable); // Aliases. - define_native_function(vm.names.valueOf, get_time, 0, attr); + define_old_native_function(vm.names.valueOf, get_time, 0, attr); // B.2.4.3 Date.prototype.toGMTString ( ), https://tc39.es/ecma262/#sec-date.prototype.togmtstring // The function object that is the initial value of Date.prototype.toGMTString diff --git a/Userland/Libraries/LibJS/Runtime/ErrorPrototype.cpp b/Userland/Libraries/LibJS/Runtime/ErrorPrototype.cpp index 1b09560b8d..c60e25f773 100644 --- a/Userland/Libraries/LibJS/Runtime/ErrorPrototype.cpp +++ b/Userland/Libraries/LibJS/Runtime/ErrorPrototype.cpp @@ -26,7 +26,7 @@ void ErrorPrototype::initialize(GlobalObject& global_object) u8 attr = Attribute::Writable | Attribute::Configurable; define_direct_property(vm.names.name, js_string(vm, "Error"), attr); define_direct_property(vm.names.message, js_string(vm, ""), attr); - define_native_function(vm.names.toString, to_string, 0, attr); + define_old_native_function(vm.names.toString, to_string, 0, attr); } // 20.5.3.4 Error.prototype.toString ( ), https://tc39.es/ecma262/#sec-error.prototype.tostring diff --git a/Userland/Libraries/LibJS/Runtime/FinalizationRegistryPrototype.cpp b/Userland/Libraries/LibJS/Runtime/FinalizationRegistryPrototype.cpp index 9b9a7dcfec..4937e297bd 100644 --- a/Userland/Libraries/LibJS/Runtime/FinalizationRegistryPrototype.cpp +++ b/Userland/Libraries/LibJS/Runtime/FinalizationRegistryPrototype.cpp @@ -20,9 +20,9 @@ void FinalizationRegistryPrototype::initialize(GlobalObject& global_object) Object::initialize(global_object); u8 attr = Attribute::Writable | Attribute::Configurable; - define_native_function(vm.names.cleanupSome, cleanup_some, 0, attr); - define_native_function(vm.names.register_, register_, 2, attr); - define_native_function(vm.names.unregister, unregister, 1, attr); + define_old_native_function(vm.names.cleanupSome, cleanup_some, 0, attr); + define_old_native_function(vm.names.register_, register_, 2, attr); + define_old_native_function(vm.names.unregister, unregister, 1, attr); // 26.2.3.4 FinalizationRegistry.prototype [ @@toStringTag ], https://tc39.es/ecma262/#sec-finalization-registry.prototype-@@tostringtag define_direct_property(*vm.well_known_symbol_to_string_tag(), js_string(global_object.heap(), vm.names.FinalizationRegistry.as_string()), Attribute::Configurable); diff --git a/Userland/Libraries/LibJS/Runtime/FunctionPrototype.cpp b/Userland/Libraries/LibJS/Runtime/FunctionPrototype.cpp index d1a25f1b53..dc94b42997 100644 --- a/Userland/Libraries/LibJS/Runtime/FunctionPrototype.cpp +++ b/Userland/Libraries/LibJS/Runtime/FunctionPrototype.cpp @@ -29,11 +29,11 @@ void FunctionPrototype::initialize(GlobalObject& global_object) auto& vm = this->vm(); Object::initialize(global_object); u8 attr = Attribute::Writable | Attribute::Configurable; - define_native_function(vm.names.apply, apply, 2, attr); - define_native_function(vm.names.bind, bind, 1, attr); - define_native_function(vm.names.call, call, 1, attr); - define_native_function(vm.names.toString, to_string, 0, attr); - define_native_function(*vm.well_known_symbol_has_instance(), symbol_has_instance, 1, 0); + define_old_native_function(vm.names.apply, apply, 2, attr); + define_old_native_function(vm.names.bind, bind, 1, attr); + define_old_native_function(vm.names.call, call, 1, attr); + define_old_native_function(vm.names.toString, to_string, 0, attr); + define_old_native_function(*vm.well_known_symbol_has_instance(), symbol_has_instance, 1, 0); define_direct_property(vm.names.length, Value(0), Attribute::Configurable); define_direct_property(vm.names.name, js_string(heap(), ""), Attribute::Configurable); } diff --git a/Userland/Libraries/LibJS/Runtime/GeneratorObjectPrototype.cpp b/Userland/Libraries/LibJS/Runtime/GeneratorObjectPrototype.cpp index 717132a4da..a322f694a0 100644 --- a/Userland/Libraries/LibJS/Runtime/GeneratorObjectPrototype.cpp +++ b/Userland/Libraries/LibJS/Runtime/GeneratorObjectPrototype.cpp @@ -20,9 +20,9 @@ void GeneratorObjectPrototype::initialize(GlobalObject& global_object) auto& vm = this->vm(); Object::initialize(global_object); u8 attr = Attribute::Writable | Attribute::Configurable; - define_native_function(vm.names.next, next, 1, attr); - define_native_function(vm.names.return_, return_, 1, attr); - define_native_function(vm.names.throw_, throw_, 1, attr); + define_old_native_function(vm.names.next, next, 1, attr); + define_old_native_function(vm.names.return_, return_, 1, attr); + define_old_native_function(vm.names.throw_, throw_, 1, attr); // 27.5.1.5 Generator.prototype [ @@toStringTag ], https://tc39.es/ecma262/#sec-generator.prototype-@@tostringtag define_direct_property(*vm.well_known_symbol_to_string_tag(), js_string(vm, "Generator"), Attribute::Configurable); diff --git a/Userland/Libraries/LibJS/Runtime/GlobalObject.cpp b/Userland/Libraries/LibJS/Runtime/GlobalObject.cpp index 9c2e8c6147..5f1276fee1 100644 --- a/Userland/Libraries/LibJS/Runtime/GlobalObject.cpp +++ b/Userland/Libraries/LibJS/Runtime/GlobalObject.cpp @@ -192,12 +192,12 @@ void GlobalObject::initialize_global_object() #undef __JS_ENUMERATE u8 attr = Attribute::Writable | Attribute::Configurable; - define_native_function(vm.names.gc, gc, 0, attr); - define_native_function(vm.names.isNaN, is_nan, 1, attr); - define_native_function(vm.names.isFinite, is_finite, 1, attr); - define_native_function(vm.names.parseFloat, parse_float, 1, attr); - define_native_function(vm.names.parseInt, parse_int, 2, attr); - define_native_function(vm.names.eval, eval, 1, attr); + define_old_native_function(vm.names.gc, gc, 0, attr); + define_old_native_function(vm.names.isNaN, is_nan, 1, attr); + define_old_native_function(vm.names.isFinite, is_finite, 1, attr); + define_old_native_function(vm.names.parseFloat, parse_float, 1, attr); + define_old_native_function(vm.names.parseInt, parse_int, 2, attr); + define_old_native_function(vm.names.eval, eval, 1, attr); // 10.2.4.1 %ThrowTypeError% ( ), https://tc39.es/ecma262/#sec-%throwtypeerror% m_throw_type_error_function = NativeFunction::create(global_object(), {}, [](VM& vm, GlobalObject& global_object) { @@ -211,12 +211,12 @@ void GlobalObject::initialize_global_object() m_function_prototype->define_direct_accessor(vm.names.caller, m_throw_type_error_function, m_throw_type_error_function, Attribute::Configurable); m_function_prototype->define_direct_accessor(vm.names.arguments, m_throw_type_error_function, m_throw_type_error_function, Attribute::Configurable); - define_native_function(vm.names.encodeURI, encode_uri, 1, attr); - define_native_function(vm.names.decodeURI, decode_uri, 1, attr); - define_native_function(vm.names.encodeURIComponent, encode_uri_component, 1, attr); - define_native_function(vm.names.decodeURIComponent, decode_uri_component, 1, attr); - define_native_function(vm.names.escape, escape, 1, attr); - define_native_function(vm.names.unescape, unescape, 1, attr); + define_old_native_function(vm.names.encodeURI, encode_uri, 1, attr); + define_old_native_function(vm.names.decodeURI, decode_uri, 1, attr); + define_old_native_function(vm.names.encodeURIComponent, encode_uri_component, 1, attr); + define_old_native_function(vm.names.decodeURIComponent, decode_uri_component, 1, attr); + define_old_native_function(vm.names.escape, escape, 1, attr); + define_old_native_function(vm.names.unescape, unescape, 1, attr); define_direct_property(vm.names.NaN, js_nan(), 0); define_direct_property(vm.names.Infinity, js_infinity(), 0); diff --git a/Userland/Libraries/LibJS/Runtime/Intl/DisplayNamesConstructor.cpp b/Userland/Libraries/LibJS/Runtime/Intl/DisplayNamesConstructor.cpp index 8173906c3a..c2a7b28140 100644 --- a/Userland/Libraries/LibJS/Runtime/Intl/DisplayNamesConstructor.cpp +++ b/Userland/Libraries/LibJS/Runtime/Intl/DisplayNamesConstructor.cpp @@ -31,7 +31,7 @@ void DisplayNamesConstructor::initialize(GlobalObject& global_object) define_direct_property(vm.names.prototype, global_object.intl_display_names_prototype(), 0); u8 attr = Attribute::Writable | Attribute::Configurable; - define_native_function(vm.names.supportedLocalesOf, supported_locales_of, 1, attr); + define_old_native_function(vm.names.supportedLocalesOf, supported_locales_of, 1, attr); define_direct_property(vm.names.length, Value(2), Attribute::Configurable); } diff --git a/Userland/Libraries/LibJS/Runtime/Intl/DisplayNamesPrototype.cpp b/Userland/Libraries/LibJS/Runtime/Intl/DisplayNamesPrototype.cpp index c1df84148c..cb0d0f63d8 100644 --- a/Userland/Libraries/LibJS/Runtime/Intl/DisplayNamesPrototype.cpp +++ b/Userland/Libraries/LibJS/Runtime/Intl/DisplayNamesPrototype.cpp @@ -28,8 +28,8 @@ void DisplayNamesPrototype::initialize(GlobalObject& global_object) define_direct_property(*vm.well_known_symbol_to_string_tag(), js_string(vm, "Intl.DisplayNames"), Attribute::Configurable); u8 attr = Attribute::Writable | Attribute::Configurable; - define_native_function(vm.names.of, of, 1, attr); - define_native_function(vm.names.resolvedOptions, resolved_options, 0, attr); + define_old_native_function(vm.names.of, of, 1, attr); + define_old_native_function(vm.names.resolvedOptions, resolved_options, 0, attr); } // 12.4.3 Intl.DisplayNames.prototype.of ( code ), https://tc39.es/ecma402/#sec-Intl.DisplayNames.prototype.of diff --git a/Userland/Libraries/LibJS/Runtime/Intl/Intl.cpp b/Userland/Libraries/LibJS/Runtime/Intl/Intl.cpp index 7a90ec5b67..7550dbcdde 100644 --- a/Userland/Libraries/LibJS/Runtime/Intl/Intl.cpp +++ b/Userland/Libraries/LibJS/Runtime/Intl/Intl.cpp @@ -36,7 +36,7 @@ void Intl::initialize(GlobalObject& global_object) define_direct_property(vm.names.Locale, global_object.intl_locale_constructor(), attr); define_direct_property(vm.names.NumberFormat, global_object.intl_number_format_constructor(), attr); - define_native_function(vm.names.getCanonicalLocales, get_canonical_locales, 1, attr); + define_old_native_function(vm.names.getCanonicalLocales, get_canonical_locales, 1, attr); } // 8.3.1 Intl.getCanonicalLocales ( locales ), https://tc39.es/ecma402/#sec-intl.getcanonicallocales diff --git a/Userland/Libraries/LibJS/Runtime/Intl/ListFormatConstructor.cpp b/Userland/Libraries/LibJS/Runtime/Intl/ListFormatConstructor.cpp index 0e1280f8e6..35d6f5cc5e 100644 --- a/Userland/Libraries/LibJS/Runtime/Intl/ListFormatConstructor.cpp +++ b/Userland/Libraries/LibJS/Runtime/Intl/ListFormatConstructor.cpp @@ -30,7 +30,7 @@ void ListFormatConstructor::initialize(GlobalObject& global_object) define_direct_property(vm.names.prototype, global_object.intl_list_format_prototype(), 0); u8 attr = Attribute::Writable | Attribute::Configurable; - define_native_function(vm.names.supportedLocalesOf, supported_locales_of, 1, attr); + define_old_native_function(vm.names.supportedLocalesOf, supported_locales_of, 1, attr); define_direct_property(vm.names.length, Value(0), Attribute::Configurable); } diff --git a/Userland/Libraries/LibJS/Runtime/Intl/ListFormatPrototype.cpp b/Userland/Libraries/LibJS/Runtime/Intl/ListFormatPrototype.cpp index 6d2cc4a38d..b42ab39d6f 100644 --- a/Userland/Libraries/LibJS/Runtime/Intl/ListFormatPrototype.cpp +++ b/Userland/Libraries/LibJS/Runtime/Intl/ListFormatPrototype.cpp @@ -28,9 +28,9 @@ void ListFormatPrototype::initialize(GlobalObject& global_object) define_direct_property(*vm.well_known_symbol_to_string_tag(), js_string(vm, "Intl.ListFormat"), Attribute::Configurable); u8 attr = Attribute::Writable | Attribute::Configurable; - define_native_function(vm.names.format, format, 1, attr); - define_native_function(vm.names.formatToParts, format_to_parts, 1, attr); - define_native_function(vm.names.resolvedOptions, resolved_options, 0, attr); + define_old_native_function(vm.names.format, format, 1, attr); + define_old_native_function(vm.names.formatToParts, format_to_parts, 1, attr); + define_old_native_function(vm.names.resolvedOptions, resolved_options, 0, attr); } // 13.4.3 Intl.ListFormat.prototype.format ( list ), https://tc39.es/ecma402/#sec-Intl.ListFormat.prototype.format diff --git a/Userland/Libraries/LibJS/Runtime/Intl/LocalePrototype.cpp b/Userland/Libraries/LibJS/Runtime/Intl/LocalePrototype.cpp index 2174270ed7..fe9cf756f2 100644 --- a/Userland/Libraries/LibJS/Runtime/Intl/LocalePrototype.cpp +++ b/Userland/Libraries/LibJS/Runtime/Intl/LocalePrototype.cpp @@ -25,23 +25,23 @@ void LocalePrototype::initialize(GlobalObject& global_object) auto& vm = this->vm(); u8 attr = Attribute::Writable | Attribute::Configurable; - define_native_function(vm.names.maximize, maximize, 0, attr); - define_native_function(vm.names.minimize, minimize, 0, attr); - define_native_function(vm.names.toString, to_string, 0, attr); + define_old_native_function(vm.names.maximize, maximize, 0, attr); + define_old_native_function(vm.names.minimize, minimize, 0, attr); + define_old_native_function(vm.names.toString, to_string, 0, attr); // 14.3.2 Intl.Locale.prototype[ @@toStringTag ], https://tc39.es/ecma402/#sec-Intl.Locale.prototype-@@tostringtag define_direct_property(*vm.well_known_symbol_to_string_tag(), js_string(vm, "Intl.Locale"), Attribute::Configurable); - define_native_accessor(vm.names.baseName, base_name, {}, Attribute::Configurable); - define_native_accessor(vm.names.calendar, calendar, {}, Attribute::Configurable); - define_native_accessor(vm.names.caseFirst, case_first, {}, Attribute::Configurable); - define_native_accessor(vm.names.collation, collation, {}, Attribute::Configurable); - define_native_accessor(vm.names.hourCycle, hour_cycle, {}, Attribute::Configurable); - define_native_accessor(vm.names.numberingSystem, numbering_system, {}, Attribute::Configurable); - define_native_accessor(vm.names.numeric, numeric, {}, Attribute::Configurable); - define_native_accessor(vm.names.language, language, {}, Attribute::Configurable); - define_native_accessor(vm.names.script, script, {}, Attribute::Configurable); - define_native_accessor(vm.names.region, region, {}, Attribute::Configurable); + define_old_native_accessor(vm.names.baseName, base_name, {}, Attribute::Configurable); + define_old_native_accessor(vm.names.calendar, calendar, {}, Attribute::Configurable); + define_old_native_accessor(vm.names.caseFirst, case_first, {}, Attribute::Configurable); + define_old_native_accessor(vm.names.collation, collation, {}, Attribute::Configurable); + define_old_native_accessor(vm.names.hourCycle, hour_cycle, {}, Attribute::Configurable); + define_old_native_accessor(vm.names.numberingSystem, numbering_system, {}, Attribute::Configurable); + define_old_native_accessor(vm.names.numeric, numeric, {}, Attribute::Configurable); + define_old_native_accessor(vm.names.language, language, {}, Attribute::Configurable); + define_old_native_accessor(vm.names.script, script, {}, Attribute::Configurable); + define_old_native_accessor(vm.names.region, region, {}, Attribute::Configurable); } // 14.3.3 Intl.Locale.prototype.maximize ( ), https://tc39.es/ecma402/#sec-Intl.Locale.prototype.maximize diff --git a/Userland/Libraries/LibJS/Runtime/Intl/NumberFormatConstructor.cpp b/Userland/Libraries/LibJS/Runtime/Intl/NumberFormatConstructor.cpp index d3377998aa..76e9f6bab7 100644 --- a/Userland/Libraries/LibJS/Runtime/Intl/NumberFormatConstructor.cpp +++ b/Userland/Libraries/LibJS/Runtime/Intl/NumberFormatConstructor.cpp @@ -29,7 +29,7 @@ void NumberFormatConstructor::initialize(GlobalObject& global_object) define_direct_property(vm.names.prototype, global_object.intl_number_format_prototype(), 0); u8 attr = Attribute::Writable | Attribute::Configurable; - define_native_function(vm.names.supportedLocalesOf, supported_locales_of, 1, attr); + define_old_native_function(vm.names.supportedLocalesOf, supported_locales_of, 1, attr); define_direct_property(vm.names.length, Value(0), Attribute::Configurable); } diff --git a/Userland/Libraries/LibJS/Runtime/Intl/NumberFormatPrototype.cpp b/Userland/Libraries/LibJS/Runtime/Intl/NumberFormatPrototype.cpp index 4bb3653ebd..bdb3c9cae7 100644 --- a/Userland/Libraries/LibJS/Runtime/Intl/NumberFormatPrototype.cpp +++ b/Userland/Libraries/LibJS/Runtime/Intl/NumberFormatPrototype.cpp @@ -27,7 +27,7 @@ void NumberFormatPrototype::initialize(GlobalObject& global_object) define_direct_property(*vm.well_known_symbol_to_string_tag(), js_string(vm, "Intl.NumberFormat"), Attribute::Configurable); u8 attr = Attribute::Writable | Attribute::Configurable; - define_native_function(vm.names.resolvedOptions, resolved_options, 0, attr); + define_old_native_function(vm.names.resolvedOptions, resolved_options, 0, attr); } // 15.4.5 Intl.NumberFormat.prototype.resolvedOptions ( ), https://tc39.es/ecma402/#sec-intl.numberformat.prototype.resolvedoptions diff --git a/Userland/Libraries/LibJS/Runtime/IteratorPrototype.cpp b/Userland/Libraries/LibJS/Runtime/IteratorPrototype.cpp index fb1f7ada9d..31d00a9b7d 100644 --- a/Userland/Libraries/LibJS/Runtime/IteratorPrototype.cpp +++ b/Userland/Libraries/LibJS/Runtime/IteratorPrototype.cpp @@ -20,7 +20,7 @@ void IteratorPrototype::initialize(GlobalObject& global_object) auto& vm = this->vm(); Object::initialize(global_object); u8 attr = Attribute::Writable | Attribute::Enumerable; - define_native_function(*vm.well_known_symbol_iterator(), symbol_iterator, 0, attr); + define_old_native_function(*vm.well_known_symbol_iterator(), symbol_iterator, 0, attr); } IteratorPrototype::~IteratorPrototype() diff --git a/Userland/Libraries/LibJS/Runtime/JSONObject.cpp b/Userland/Libraries/LibJS/Runtime/JSONObject.cpp index 6f85b3b598..f51c49f45a 100644 --- a/Userland/Libraries/LibJS/Runtime/JSONObject.cpp +++ b/Userland/Libraries/LibJS/Runtime/JSONObject.cpp @@ -33,8 +33,8 @@ void JSONObject::initialize(GlobalObject& global_object) auto& vm = this->vm(); Object::initialize(global_object); u8 attr = Attribute::Writable | Attribute::Configurable; - define_native_function(vm.names.stringify, stringify, 3, attr); - define_native_function(vm.names.parse, parse, 2, attr); + define_old_native_function(vm.names.stringify, stringify, 3, attr); + define_old_native_function(vm.names.parse, parse, 2, attr); // 25.5.3 JSON [ @@toStringTag ], https://tc39.es/ecma262/#sec-json-@@tostringtag define_direct_property(*vm.well_known_symbol_to_string_tag(), js_string(global_object.heap(), "JSON"), Attribute::Configurable); diff --git a/Userland/Libraries/LibJS/Runtime/MapConstructor.cpp b/Userland/Libraries/LibJS/Runtime/MapConstructor.cpp index 0090a23476..24a0829a28 100644 --- a/Userland/Libraries/LibJS/Runtime/MapConstructor.cpp +++ b/Userland/Libraries/LibJS/Runtime/MapConstructor.cpp @@ -26,7 +26,7 @@ void MapConstructor::initialize(GlobalObject& global_object) // 24.1.2.1 Map.prototype, https://tc39.es/ecma262/#sec-map.prototype define_direct_property(vm.names.prototype, global_object.map_prototype(), 0); - define_native_accessor(*vm.well_known_symbol_species(), symbol_species_getter, {}, Attribute::Configurable); + define_old_native_accessor(*vm.well_known_symbol_species(), symbol_species_getter, {}, Attribute::Configurable); define_direct_property(vm.names.length, Value(0), Attribute::Configurable); } diff --git a/Userland/Libraries/LibJS/Runtime/MapIteratorPrototype.cpp b/Userland/Libraries/LibJS/Runtime/MapIteratorPrototype.cpp index 1ba42c2111..8be40ce855 100644 --- a/Userland/Libraries/LibJS/Runtime/MapIteratorPrototype.cpp +++ b/Userland/Libraries/LibJS/Runtime/MapIteratorPrototype.cpp @@ -23,7 +23,7 @@ void MapIteratorPrototype::initialize(GlobalObject& global_object) auto& vm = this->vm(); Object::initialize(global_object); - define_native_function(vm.names.next, next, 0, Attribute::Configurable | Attribute::Writable); + define_old_native_function(vm.names.next, next, 0, Attribute::Configurable | Attribute::Writable); define_direct_property(*vm.well_known_symbol_to_string_tag(), js_string(global_object.heap(), "Map Iterator"), Attribute::Configurable); } diff --git a/Userland/Libraries/LibJS/Runtime/MapPrototype.cpp b/Userland/Libraries/LibJS/Runtime/MapPrototype.cpp index 5d5e879f1f..737011d0a1 100644 --- a/Userland/Libraries/LibJS/Runtime/MapPrototype.cpp +++ b/Userland/Libraries/LibJS/Runtime/MapPrototype.cpp @@ -22,17 +22,17 @@ void MapPrototype::initialize(GlobalObject& global_object) Object::initialize(global_object); u8 attr = Attribute::Writable | Attribute::Configurable; - define_native_function(vm.names.clear, clear, 0, attr); - define_native_function(vm.names.delete_, delete_, 1, attr); - define_native_function(vm.names.entries, entries, 0, attr); - define_native_function(vm.names.forEach, for_each, 1, attr); - define_native_function(vm.names.get, get, 1, attr); - define_native_function(vm.names.has, has, 1, attr); - define_native_function(vm.names.keys, keys, 0, attr); - define_native_function(vm.names.set, set, 2, attr); - define_native_function(vm.names.values, values, 0, attr); - - define_native_accessor(vm.names.size, size_getter, {}, Attribute::Configurable); + define_old_native_function(vm.names.clear, clear, 0, attr); + define_old_native_function(vm.names.delete_, delete_, 1, attr); + define_old_native_function(vm.names.entries, entries, 0, attr); + define_old_native_function(vm.names.forEach, for_each, 1, attr); + define_old_native_function(vm.names.get, get, 1, attr); + define_old_native_function(vm.names.has, has, 1, attr); + define_old_native_function(vm.names.keys, keys, 0, attr); + define_old_native_function(vm.names.set, set, 2, attr); + define_old_native_function(vm.names.values, values, 0, attr); + + define_old_native_accessor(vm.names.size, size_getter, {}, Attribute::Configurable); define_direct_property(*vm.well_known_symbol_iterator(), get_without_side_effects(vm.names.entries), attr); define_direct_property(*vm.well_known_symbol_to_string_tag(), js_string(global_object.heap(), vm.names.Map.as_string()), Attribute::Configurable); diff --git a/Userland/Libraries/LibJS/Runtime/MathObject.cpp b/Userland/Libraries/LibJS/Runtime/MathObject.cpp index 05986f59e5..078e2467a7 100644 --- a/Userland/Libraries/LibJS/Runtime/MathObject.cpp +++ b/Userland/Libraries/LibJS/Runtime/MathObject.cpp @@ -24,41 +24,41 @@ void MathObject::initialize(GlobalObject& global_object) auto& vm = this->vm(); Object::initialize(global_object); u8 attr = Attribute::Writable | Attribute::Configurable; - define_native_function(vm.names.abs, abs, 1, attr); - define_native_function(vm.names.random, random, 0, attr); - define_native_function(vm.names.sqrt, sqrt, 1, attr); - define_native_function(vm.names.floor, floor, 1, attr); - define_native_function(vm.names.ceil, ceil, 1, attr); - define_native_function(vm.names.round, round, 1, attr); - define_native_function(vm.names.max, max, 2, attr); - define_native_function(vm.names.min, min, 2, attr); - define_native_function(vm.names.trunc, trunc, 1, attr); - define_native_function(vm.names.sin, sin, 1, attr); - define_native_function(vm.names.cos, cos, 1, attr); - define_native_function(vm.names.tan, tan, 1, attr); - define_native_function(vm.names.pow, pow, 2, attr); - define_native_function(vm.names.exp, exp, 1, attr); - define_native_function(vm.names.expm1, expm1, 1, attr); - define_native_function(vm.names.sign, sign, 1, attr); - define_native_function(vm.names.clz32, clz32, 1, attr); - define_native_function(vm.names.acos, acos, 1, attr); - define_native_function(vm.names.acosh, acosh, 1, attr); - define_native_function(vm.names.asin, asin, 1, attr); - define_native_function(vm.names.asinh, asinh, 1, attr); - define_native_function(vm.names.atan, atan, 1, attr); - define_native_function(vm.names.atanh, atanh, 1, attr); - define_native_function(vm.names.log1p, log1p, 1, attr); - define_native_function(vm.names.cbrt, cbrt, 1, attr); - define_native_function(vm.names.atan2, atan2, 2, attr); - define_native_function(vm.names.fround, fround, 1, attr); - define_native_function(vm.names.hypot, hypot, 2, attr); - define_native_function(vm.names.imul, imul, 2, attr); - define_native_function(vm.names.log, log, 1, attr); - define_native_function(vm.names.log2, log2, 1, attr); - define_native_function(vm.names.log10, log10, 1, attr); - define_native_function(vm.names.sinh, sinh, 1, attr); - define_native_function(vm.names.cosh, cosh, 1, attr); - define_native_function(vm.names.tanh, tanh, 1, attr); + define_old_native_function(vm.names.abs, abs, 1, attr); + define_old_native_function(vm.names.random, random, 0, attr); + define_old_native_function(vm.names.sqrt, sqrt, 1, attr); + define_old_native_function(vm.names.floor, floor, 1, attr); + define_old_native_function(vm.names.ceil, ceil, 1, attr); + define_old_native_function(vm.names.round, round, 1, attr); + define_old_native_function(vm.names.max, max, 2, attr); + define_old_native_function(vm.names.min, min, 2, attr); + define_old_native_function(vm.names.trunc, trunc, 1, attr); + define_old_native_function(vm.names.sin, sin, 1, attr); + define_old_native_function(vm.names.cos, cos, 1, attr); + define_old_native_function(vm.names.tan, tan, 1, attr); + define_old_native_function(vm.names.pow, pow, 2, attr); + define_old_native_function(vm.names.exp, exp, 1, attr); + define_old_native_function(vm.names.expm1, expm1, 1, attr); + define_old_native_function(vm.names.sign, sign, 1, attr); + define_old_native_function(vm.names.clz32, clz32, 1, attr); + define_old_native_function(vm.names.acos, acos, 1, attr); + define_old_native_function(vm.names.acosh, acosh, 1, attr); + define_old_native_function(vm.names.asin, asin, 1, attr); + define_old_native_function(vm.names.asinh, asinh, 1, attr); + define_old_native_function(vm.names.atan, atan, 1, attr); + define_old_native_function(vm.names.atanh, atanh, 1, attr); + define_old_native_function(vm.names.log1p, log1p, 1, attr); + define_old_native_function(vm.names.cbrt, cbrt, 1, attr); + define_old_native_function(vm.names.atan2, atan2, 2, attr); + define_old_native_function(vm.names.fround, fround, 1, attr); + define_old_native_function(vm.names.hypot, hypot, 2, attr); + define_old_native_function(vm.names.imul, imul, 2, attr); + define_old_native_function(vm.names.log, log, 1, attr); + define_old_native_function(vm.names.log2, log2, 1, attr); + define_old_native_function(vm.names.log10, log10, 1, attr); + define_old_native_function(vm.names.sinh, sinh, 1, attr); + define_old_native_function(vm.names.cosh, cosh, 1, attr); + define_old_native_function(vm.names.tanh, tanh, 1, attr); // 21.3.1 Value Properties of the Math Object, https://tc39.es/ecma262/#sec-value-properties-of-the-math-object define_direct_property(vm.names.E, Value(M_E), 0); diff --git a/Userland/Libraries/LibJS/Runtime/NumberConstructor.cpp b/Userland/Libraries/LibJS/Runtime/NumberConstructor.cpp index c0bee463e0..32a5768e9f 100644 --- a/Userland/Libraries/LibJS/Runtime/NumberConstructor.cpp +++ b/Userland/Libraries/LibJS/Runtime/NumberConstructor.cpp @@ -37,10 +37,10 @@ void NumberConstructor::initialize(GlobalObject& global_object) define_direct_property(vm.names.prototype, global_object.number_prototype(), 0); u8 attr = Attribute::Writable | Attribute::Configurable; - define_native_function(vm.names.isFinite, is_finite, 1, attr); - define_native_function(vm.names.isInteger, is_integer, 1, attr); - define_native_function(vm.names.isNaN, is_nan, 1, attr); - define_native_function(vm.names.isSafeInteger, is_safe_integer, 1, attr); + define_old_native_function(vm.names.isFinite, is_finite, 1, attr); + define_old_native_function(vm.names.isInteger, is_integer, 1, attr); + define_old_native_function(vm.names.isNaN, is_nan, 1, attr); + define_old_native_function(vm.names.isSafeInteger, is_safe_integer, 1, attr); define_direct_property(vm.names.parseInt, global_object.get_without_side_effects(vm.names.parseInt), attr); define_direct_property(vm.names.parseFloat, global_object.get_without_side_effects(vm.names.parseFloat), attr); define_direct_property(vm.names.EPSILON, Value(EPSILON_VALUE), 0); diff --git a/Userland/Libraries/LibJS/Runtime/NumberPrototype.cpp b/Userland/Libraries/LibJS/Runtime/NumberPrototype.cpp index 7aeb109d0b..4459191df9 100644 --- a/Userland/Libraries/LibJS/Runtime/NumberPrototype.cpp +++ b/Userland/Libraries/LibJS/Runtime/NumberPrototype.cpp @@ -36,9 +36,9 @@ void NumberPrototype::initialize(GlobalObject& object) auto& vm = this->vm(); Object::initialize(object); u8 attr = Attribute::Configurable | Attribute::Writable; - define_native_function(vm.names.toFixed, to_fixed, 1, attr); - define_native_function(vm.names.toString, to_string, 1, attr); - define_native_function(vm.names.valueOf, value_of, 0, attr); + define_old_native_function(vm.names.toFixed, to_fixed, 1, attr); + define_old_native_function(vm.names.toString, to_string, 1, attr); + define_old_native_function(vm.names.valueOf, value_of, 0, attr); } NumberPrototype::~NumberPrototype() diff --git a/Userland/Libraries/LibJS/Runtime/Object.cpp b/Userland/Libraries/LibJS/Runtime/Object.cpp index dde9beb577..ff64550682 100644 --- a/Userland/Libraries/LibJS/Runtime/Object.cpp +++ b/Userland/Libraries/LibJS/Runtime/Object.cpp @@ -950,7 +950,7 @@ void Object::set_prototype(Object* new_prototype) m_shape = shape.create_prototype_transition(new_prototype); } -void Object::define_native_accessor(PropertyName const& property_name, Function<Value(VM&, GlobalObject&)> getter, Function<Value(VM&, GlobalObject&)> setter, PropertyAttributes attribute) +void Object::define_old_native_accessor(PropertyName const& property_name, Function<Value(VM&, GlobalObject&)> getter, Function<Value(VM&, GlobalObject&)> setter, PropertyAttributes attribute) { Function<ThrowCompletionOr<Value>(VM&, GlobalObject&)> completion_getter = {}; if (getter) { @@ -970,10 +970,10 @@ void Object::define_native_accessor(PropertyName const& property_name, Function< return result; }; } - define_new_native_accessor(property_name, move(completion_getter), move(completion_setter), attribute); + define_native_accessor(property_name, move(completion_getter), move(completion_setter), attribute); } -void Object::define_new_native_accessor(PropertyName const& property_name, Function<ThrowCompletionOr<Value>(VM&, GlobalObject&)> getter, Function<ThrowCompletionOr<Value>(VM&, GlobalObject&)> setter, PropertyAttributes attribute) +void Object::define_native_accessor(PropertyName const& property_name, Function<ThrowCompletionOr<Value>(VM&, GlobalObject&)> getter, Function<ThrowCompletionOr<Value>(VM&, GlobalObject&)> setter, PropertyAttributes attribute) { auto& vm = this->vm(); String formatted_property_name; @@ -1039,7 +1039,7 @@ Value Object::get_without_side_effects(const PropertyName& property_name) const return {}; } -void Object::define_native_function(PropertyName const& property_name, Function<Value(VM&, GlobalObject&)> native_function, i32 length, PropertyAttributes attribute) +void Object::define_old_native_function(PropertyName const& property_name, Function<Value(VM&, GlobalObject&)> native_function, i32 length, PropertyAttributes attribute) { auto completion_native_function = [native_function = move(native_function), property_name](auto& vm, auto& global_object) -> ThrowCompletionOr<Value> { auto result = native_function(vm, global_object); @@ -1047,10 +1047,10 @@ void Object::define_native_function(PropertyName const& property_name, Function< return throw_completion(exception->value()); return result; }; - define_new_native_function(property_name, move(completion_native_function), length, attribute); + define_native_function(property_name, move(completion_native_function), length, attribute); } -void Object::define_new_native_function(PropertyName const& property_name, Function<ThrowCompletionOr<Value>(VM&, GlobalObject&)> native_function, i32 length, PropertyAttributes attribute) +void Object::define_native_function(PropertyName const& property_name, Function<ThrowCompletionOr<Value>(VM&, GlobalObject&)> native_function, i32 length, PropertyAttributes attribute) { auto& vm = this->vm(); String function_name; diff --git a/Userland/Libraries/LibJS/Runtime/Object.h b/Userland/Libraries/LibJS/Runtime/Object.h index 2c19851251..06fa5746a8 100644 --- a/Userland/Libraries/LibJS/Runtime/Object.h +++ b/Userland/Libraries/LibJS/Runtime/Object.h @@ -129,11 +129,11 @@ public: void define_direct_accessor(PropertyName const&, FunctionObject* getter, FunctionObject* setter, PropertyAttributes attributes); // Legacy methods - Remove once JS_DECLARE_OLD_NATIVE_FUNCTION is removed - void define_native_function(PropertyName const&, Function<Value(VM&, GlobalObject&)>, i32 length, PropertyAttributes attributes); - void define_native_accessor(PropertyName const&, Function<Value(VM&, GlobalObject&)> getter, Function<Value(VM&, GlobalObject&)> setter, PropertyAttributes attributes); + void define_old_native_function(PropertyName const&, Function<Value(VM&, GlobalObject&)>, i32 length, PropertyAttributes attributes); + void define_old_native_accessor(PropertyName const&, Function<Value(VM&, GlobalObject&)> getter, Function<Value(VM&, GlobalObject&)> setter, PropertyAttributes attributes); - void define_new_native_function(PropertyName const&, Function<ThrowCompletionOr<Value>(VM&, GlobalObject&)>, i32 length, PropertyAttributes attributes); - void define_new_native_accessor(PropertyName const&, Function<ThrowCompletionOr<Value>(VM&, GlobalObject&)> getter, Function<ThrowCompletionOr<Value>(VM&, GlobalObject&)> setter, PropertyAttributes attributes); + void define_native_function(PropertyName const&, Function<ThrowCompletionOr<Value>(VM&, GlobalObject&)>, i32 length, PropertyAttributes attributes); + void define_native_accessor(PropertyName const&, Function<ThrowCompletionOr<Value>(VM&, GlobalObject&)> getter, Function<ThrowCompletionOr<Value>(VM&, GlobalObject&)> setter, PropertyAttributes attributes); virtual bool is_function() const { return false; } virtual bool is_typed_array() const { return false; } diff --git a/Userland/Libraries/LibJS/Runtime/ObjectConstructor.cpp b/Userland/Libraries/LibJS/Runtime/ObjectConstructor.cpp index 9494f16623..0dbf0d3922 100644 --- a/Userland/Libraries/LibJS/Runtime/ObjectConstructor.cpp +++ b/Userland/Libraries/LibJS/Runtime/ObjectConstructor.cpp @@ -31,28 +31,28 @@ void ObjectConstructor::initialize(GlobalObject& global_object) define_direct_property(vm.names.prototype, global_object.object_prototype(), 0); u8 attr = Attribute::Writable | Attribute::Configurable; - define_native_function(vm.names.defineProperty, define_property, 3, attr); - define_native_function(vm.names.defineProperties, define_properties, 2, attr); - define_native_function(vm.names.is, is, 2, attr); - define_native_function(vm.names.getOwnPropertyDescriptor, get_own_property_descriptor, 2, attr); - define_native_function(vm.names.getOwnPropertyDescriptors, get_own_property_descriptors, 1, attr); - define_native_function(vm.names.getOwnPropertyNames, get_own_property_names, 1, attr); - define_native_function(vm.names.getOwnPropertySymbols, get_own_property_symbols, 1, attr); - define_native_function(vm.names.getPrototypeOf, get_prototype_of, 1, attr); - define_native_function(vm.names.setPrototypeOf, set_prototype_of, 2, attr); - define_native_function(vm.names.isExtensible, is_extensible, 1, attr); - define_native_function(vm.names.isFrozen, is_frozen, 1, attr); - define_native_function(vm.names.isSealed, is_sealed, 1, attr); - define_native_function(vm.names.preventExtensions, prevent_extensions, 1, attr); - define_native_function(vm.names.freeze, freeze, 1, attr); - define_native_function(vm.names.fromEntries, from_entries, 1, attr); - define_native_function(vm.names.seal, seal, 1, attr); - define_native_function(vm.names.keys, keys, 1, attr); - define_native_function(vm.names.values, values, 1, attr); - define_native_function(vm.names.entries, entries, 1, attr); - define_native_function(vm.names.create, create, 2, attr); - define_native_function(vm.names.hasOwn, has_own, 2, attr); - define_native_function(vm.names.assign, assign, 2, attr); + define_old_native_function(vm.names.defineProperty, define_property, 3, attr); + define_old_native_function(vm.names.defineProperties, define_properties, 2, attr); + define_old_native_function(vm.names.is, is, 2, attr); + define_old_native_function(vm.names.getOwnPropertyDescriptor, get_own_property_descriptor, 2, attr); + define_old_native_function(vm.names.getOwnPropertyDescriptors, get_own_property_descriptors, 1, attr); + define_old_native_function(vm.names.getOwnPropertyNames, get_own_property_names, 1, attr); + define_old_native_function(vm.names.getOwnPropertySymbols, get_own_property_symbols, 1, attr); + define_old_native_function(vm.names.getPrototypeOf, get_prototype_of, 1, attr); + define_old_native_function(vm.names.setPrototypeOf, set_prototype_of, 2, attr); + define_old_native_function(vm.names.isExtensible, is_extensible, 1, attr); + define_old_native_function(vm.names.isFrozen, is_frozen, 1, attr); + define_old_native_function(vm.names.isSealed, is_sealed, 1, attr); + define_old_native_function(vm.names.preventExtensions, prevent_extensions, 1, attr); + define_old_native_function(vm.names.freeze, freeze, 1, attr); + define_old_native_function(vm.names.fromEntries, from_entries, 1, attr); + define_old_native_function(vm.names.seal, seal, 1, attr); + define_old_native_function(vm.names.keys, keys, 1, attr); + define_old_native_function(vm.names.values, values, 1, attr); + define_old_native_function(vm.names.entries, entries, 1, attr); + define_old_native_function(vm.names.create, create, 2, attr); + define_old_native_function(vm.names.hasOwn, has_own, 2, attr); + define_old_native_function(vm.names.assign, assign, 2, attr); define_direct_property(vm.names.length, Value(1), Attribute::Configurable); } diff --git a/Userland/Libraries/LibJS/Runtime/ObjectPrototype.cpp b/Userland/Libraries/LibJS/Runtime/ObjectPrototype.cpp index 6f2b765782..99a8c6b96a 100644 --- a/Userland/Libraries/LibJS/Runtime/ObjectPrototype.cpp +++ b/Userland/Libraries/LibJS/Runtime/ObjectPrototype.cpp @@ -33,19 +33,19 @@ void ObjectPrototype::initialize(GlobalObject& global_object) // This must be called after the constructor has returned, so that the below code // can find the ObjectPrototype through normal paths. u8 attr = Attribute::Writable | Attribute::Configurable; - define_native_function(vm.names.hasOwnProperty, has_own_property, 1, attr); - define_native_function(vm.names.toString, to_string, 0, attr); - define_native_function(vm.names.toLocaleString, to_locale_string, 0, attr); - define_native_function(vm.names.valueOf, value_of, 0, attr); - define_native_function(vm.names.propertyIsEnumerable, property_is_enumerable, 1, attr); - define_native_function(vm.names.isPrototypeOf, is_prototype_of, 1, attr); + define_old_native_function(vm.names.hasOwnProperty, has_own_property, 1, attr); + define_old_native_function(vm.names.toString, to_string, 0, attr); + define_old_native_function(vm.names.toLocaleString, to_locale_string, 0, attr); + define_old_native_function(vm.names.valueOf, value_of, 0, attr); + define_old_native_function(vm.names.propertyIsEnumerable, property_is_enumerable, 1, attr); + define_old_native_function(vm.names.isPrototypeOf, is_prototype_of, 1, attr); // Annex B - define_native_function(vm.names.__defineGetter__, define_getter, 2, attr); - define_native_function(vm.names.__defineSetter__, define_setter, 2, attr); - define_native_function(vm.names.__lookupGetter__, lookup_getter, 1, attr); - define_native_function(vm.names.__lookupSetter__, lookup_setter, 1, attr); - define_native_accessor(vm.names.__proto__, proto_getter, proto_setter, Attribute::Configurable); + define_old_native_function(vm.names.__defineGetter__, define_getter, 2, attr); + define_old_native_function(vm.names.__defineSetter__, define_setter, 2, attr); + define_old_native_function(vm.names.__lookupGetter__, lookup_getter, 1, attr); + define_old_native_function(vm.names.__lookupSetter__, lookup_setter, 1, attr); + define_old_native_accessor(vm.names.__proto__, proto_getter, proto_setter, Attribute::Configurable); } ObjectPrototype::~ObjectPrototype() diff --git a/Userland/Libraries/LibJS/Runtime/PromiseConstructor.cpp b/Userland/Libraries/LibJS/Runtime/PromiseConstructor.cpp index 1a1829f6ea..f576de8f4f 100644 --- a/Userland/Libraries/LibJS/Runtime/PromiseConstructor.cpp +++ b/Userland/Libraries/LibJS/Runtime/PromiseConstructor.cpp @@ -223,14 +223,14 @@ void PromiseConstructor::initialize(GlobalObject& global_object) define_direct_property(vm.names.prototype, global_object.promise_prototype(), 0); u8 attr = Attribute::Writable | Attribute::Configurable; - define_native_function(vm.names.all, all, 1, attr); - define_native_function(vm.names.allSettled, all_settled, 1, attr); - define_native_function(vm.names.any, any, 1, attr); - define_native_function(vm.names.race, race, 1, attr); - define_native_function(vm.names.reject, reject, 1, attr); - define_native_function(vm.names.resolve, resolve, 1, attr); - - define_native_accessor(*vm.well_known_symbol_species(), symbol_species_getter, {}, Attribute::Configurable); + define_old_native_function(vm.names.all, all, 1, attr); + define_old_native_function(vm.names.allSettled, all_settled, 1, attr); + define_old_native_function(vm.names.any, any, 1, attr); + define_old_native_function(vm.names.race, race, 1, attr); + define_old_native_function(vm.names.reject, reject, 1, attr); + define_old_native_function(vm.names.resolve, resolve, 1, attr); + + define_old_native_accessor(*vm.well_known_symbol_species(), symbol_species_getter, {}, Attribute::Configurable); define_direct_property(vm.names.length, Value(1), Attribute::Configurable); } diff --git a/Userland/Libraries/LibJS/Runtime/PromisePrototype.cpp b/Userland/Libraries/LibJS/Runtime/PromisePrototype.cpp index 1dac15c036..1dc34b5c3a 100644 --- a/Userland/Libraries/LibJS/Runtime/PromisePrototype.cpp +++ b/Userland/Libraries/LibJS/Runtime/PromisePrototype.cpp @@ -27,9 +27,9 @@ void PromisePrototype::initialize(GlobalObject& global_object) Object::initialize(global_object); u8 attr = Attribute::Writable | Attribute::Configurable; - define_native_function(vm.names.then, then, 2, attr); - define_native_function(vm.names.catch_, catch_, 1, attr); - define_native_function(vm.names.finally, finally, 1, attr); + define_old_native_function(vm.names.then, then, 2, attr); + define_old_native_function(vm.names.catch_, catch_, 1, attr); + define_old_native_function(vm.names.finally, finally, 1, attr); // 27.2.5.5 Promise.prototype [ @@toStringTag ], https://tc39.es/ecma262/#sec-promise.prototype-@@tostringtag define_direct_property(*vm.well_known_symbol_to_string_tag(), js_string(vm, vm.names.Promise.as_string()), Attribute::Configurable); diff --git a/Userland/Libraries/LibJS/Runtime/ProxyConstructor.cpp b/Userland/Libraries/LibJS/Runtime/ProxyConstructor.cpp index ada40fab71..33596e4f53 100644 --- a/Userland/Libraries/LibJS/Runtime/ProxyConstructor.cpp +++ b/Userland/Libraries/LibJS/Runtime/ProxyConstructor.cpp @@ -38,7 +38,7 @@ void ProxyConstructor::initialize(GlobalObject& global_object) auto& vm = this->vm(); NativeFunction::initialize(global_object); u8 attr = Attribute::Writable | Attribute::Configurable; - define_native_function(vm.names.revocable, revocable, 2, attr); + define_old_native_function(vm.names.revocable, revocable, 2, attr); define_direct_property(vm.names.length, Value(2), Attribute::Configurable); } diff --git a/Userland/Libraries/LibJS/Runtime/ReflectObject.cpp b/Userland/Libraries/LibJS/Runtime/ReflectObject.cpp index 5915fcde97..b597067fa7 100644 --- a/Userland/Libraries/LibJS/Runtime/ReflectObject.cpp +++ b/Userland/Libraries/LibJS/Runtime/ReflectObject.cpp @@ -25,19 +25,19 @@ void ReflectObject::initialize(GlobalObject& global_object) auto& vm = this->vm(); Object::initialize(global_object); u8 attr = Attribute::Writable | Attribute::Configurable; - define_native_function(vm.names.apply, apply, 3, attr); - define_native_function(vm.names.construct, construct, 2, attr); - define_native_function(vm.names.defineProperty, define_property, 3, attr); - define_native_function(vm.names.deleteProperty, delete_property, 2, attr); - define_native_function(vm.names.get, get, 2, attr); - define_native_function(vm.names.getOwnPropertyDescriptor, get_own_property_descriptor, 2, attr); - define_native_function(vm.names.getPrototypeOf, get_prototype_of, 1, attr); - define_native_function(vm.names.has, has, 2, attr); - define_native_function(vm.names.isExtensible, is_extensible, 1, attr); - define_native_function(vm.names.ownKeys, own_keys, 1, attr); - define_native_function(vm.names.preventExtensions, prevent_extensions, 1, attr); - define_native_function(vm.names.set, set, 3, attr); - define_native_function(vm.names.setPrototypeOf, set_prototype_of, 2, attr); + define_old_native_function(vm.names.apply, apply, 3, attr); + define_old_native_function(vm.names.construct, construct, 2, attr); + define_old_native_function(vm.names.defineProperty, define_property, 3, attr); + define_old_native_function(vm.names.deleteProperty, delete_property, 2, attr); + define_old_native_function(vm.names.get, get, 2, attr); + define_old_native_function(vm.names.getOwnPropertyDescriptor, get_own_property_descriptor, 2, attr); + define_old_native_function(vm.names.getPrototypeOf, get_prototype_of, 1, attr); + define_old_native_function(vm.names.has, has, 2, attr); + define_old_native_function(vm.names.isExtensible, is_extensible, 1, attr); + define_old_native_function(vm.names.ownKeys, own_keys, 1, attr); + define_old_native_function(vm.names.preventExtensions, prevent_extensions, 1, attr); + define_old_native_function(vm.names.set, set, 3, attr); + define_old_native_function(vm.names.setPrototypeOf, set_prototype_of, 2, attr); // 28.1.14 Reflect [ @@toStringTag ], https://tc39.es/ecma262/#sec-reflect-@@tostringtag define_direct_property(*vm.well_known_symbol_to_string_tag(), js_string(vm, vm.names.Reflect.as_string()), Attribute::Configurable); diff --git a/Userland/Libraries/LibJS/Runtime/RegExpConstructor.cpp b/Userland/Libraries/LibJS/Runtime/RegExpConstructor.cpp index 34afe2faa1..6320e826b9 100644 --- a/Userland/Libraries/LibJS/Runtime/RegExpConstructor.cpp +++ b/Userland/Libraries/LibJS/Runtime/RegExpConstructor.cpp @@ -24,7 +24,7 @@ void RegExpConstructor::initialize(GlobalObject& global_object) // 22.2.4.1 RegExp.prototype, https://tc39.es/ecma262/#sec-regexp.prototype define_direct_property(vm.names.prototype, global_object.regexp_prototype(), 0); - define_native_accessor(*vm.well_known_symbol_species(), symbol_species_getter, {}, Attribute::Configurable); + define_old_native_accessor(*vm.well_known_symbol_species(), symbol_species_getter, {}, Attribute::Configurable); define_direct_property(vm.names.length, Value(2), Attribute::Configurable); } diff --git a/Userland/Libraries/LibJS/Runtime/RegExpPrototype.cpp b/Userland/Libraries/LibJS/Runtime/RegExpPrototype.cpp index 123187357f..a8b5290cef 100644 --- a/Userland/Libraries/LibJS/Runtime/RegExpPrototype.cpp +++ b/Userland/Libraries/LibJS/Runtime/RegExpPrototype.cpp @@ -31,22 +31,22 @@ void RegExpPrototype::initialize(GlobalObject& global_object) auto& vm = this->vm(); Object::initialize(global_object); u8 attr = Attribute::Writable | Attribute::Configurable; - define_native_function(vm.names.toString, to_string, 0, attr); - define_native_function(vm.names.test, test, 1, attr); - define_native_function(vm.names.exec, exec, 1, attr); - define_native_function(vm.names.compile, compile, 2, attr); + define_old_native_function(vm.names.toString, to_string, 0, attr); + define_old_native_function(vm.names.test, test, 1, attr); + define_old_native_function(vm.names.exec, exec, 1, attr); + define_old_native_function(vm.names.compile, compile, 2, attr); - define_native_function(*vm.well_known_symbol_match(), symbol_match, 1, attr); - define_native_function(*vm.well_known_symbol_match_all(), symbol_match_all, 1, attr); - define_native_function(*vm.well_known_symbol_replace(), symbol_replace, 2, attr); - define_native_function(*vm.well_known_symbol_search(), symbol_search, 1, attr); - define_native_function(*vm.well_known_symbol_split(), symbol_split, 2, attr); + define_old_native_function(*vm.well_known_symbol_match(), symbol_match, 1, attr); + define_old_native_function(*vm.well_known_symbol_match_all(), symbol_match_all, 1, attr); + define_old_native_function(*vm.well_known_symbol_replace(), symbol_replace, 2, attr); + define_old_native_function(*vm.well_known_symbol_search(), symbol_search, 1, attr); + define_old_native_function(*vm.well_known_symbol_split(), symbol_split, 2, attr); - define_native_accessor(vm.names.flags, flags, {}, Attribute::Configurable); - define_native_accessor(vm.names.source, source, {}, Attribute::Configurable); + define_old_native_accessor(vm.names.flags, flags, {}, Attribute::Configurable); + define_old_native_accessor(vm.names.source, source, {}, Attribute::Configurable); #define __JS_ENUMERATE(flagName, flag_name, flag_char) \ - define_native_accessor(vm.names.flagName, flag_name, {}, Attribute::Configurable); + define_old_native_accessor(vm.names.flagName, flag_name, {}, Attribute::Configurable); JS_ENUMERATE_REGEXP_FLAGS #undef __JS_ENUMERATE } diff --git a/Userland/Libraries/LibJS/Runtime/RegExpStringIteratorPrototype.cpp b/Userland/Libraries/LibJS/Runtime/RegExpStringIteratorPrototype.cpp index 095490d52d..3cea7a0066 100644 --- a/Userland/Libraries/LibJS/Runtime/RegExpStringIteratorPrototype.cpp +++ b/Userland/Libraries/LibJS/Runtime/RegExpStringIteratorPrototype.cpp @@ -23,7 +23,7 @@ void RegExpStringIteratorPrototype::initialize(GlobalObject& global_object) auto& vm = this->vm(); u8 attr = Attribute::Writable | Attribute::Configurable; - define_native_function(vm.names.next, next, 0, attr); + define_old_native_function(vm.names.next, next, 0, attr); // 22.2.7.2.2 %RegExpStringIteratorPrototype% [ @@toStringTag ], https://tc39.es/ecma262/#sec-%regexpstringiteratorprototype%-@@tostringtag define_direct_property(*vm.well_known_symbol_to_string_tag(), js_string(global_object.heap(), "RegExp String Iterator"), Attribute::Configurable); diff --git a/Userland/Libraries/LibJS/Runtime/SetConstructor.cpp b/Userland/Libraries/LibJS/Runtime/SetConstructor.cpp index 719af0222e..fa10df35fc 100644 --- a/Userland/Libraries/LibJS/Runtime/SetConstructor.cpp +++ b/Userland/Libraries/LibJS/Runtime/SetConstructor.cpp @@ -26,7 +26,7 @@ void SetConstructor::initialize(GlobalObject& global_object) // 24.2.2.1 Set.prototype, https://tc39.es/ecma262/#sec-set.prototype define_direct_property(vm.names.prototype, global_object.set_prototype(), 0); - define_native_accessor(*vm.well_known_symbol_species(), symbol_species_getter, {}, Attribute::Configurable); + define_old_native_accessor(*vm.well_known_symbol_species(), symbol_species_getter, {}, Attribute::Configurable); define_direct_property(vm.names.length, Value(0), Attribute::Configurable); } diff --git a/Userland/Libraries/LibJS/Runtime/SetIteratorPrototype.cpp b/Userland/Libraries/LibJS/Runtime/SetIteratorPrototype.cpp index c87be65029..0b47ac4e9a 100644 --- a/Userland/Libraries/LibJS/Runtime/SetIteratorPrototype.cpp +++ b/Userland/Libraries/LibJS/Runtime/SetIteratorPrototype.cpp @@ -23,7 +23,7 @@ void SetIteratorPrototype::initialize(GlobalObject& global_object) auto& vm = this->vm(); Object::initialize(global_object); - define_native_function(vm.names.next, next, 0, Attribute::Configurable | Attribute::Writable); + define_old_native_function(vm.names.next, next, 0, Attribute::Configurable | Attribute::Writable); // 24.2.5.2.2 %SetIteratorPrototype% [ @@toStringTag ], https://tc39.es/ecma262/#sec-%setiteratorprototype%-@@tostringtag define_direct_property(*vm.well_known_symbol_to_string_tag(), js_string(global_object.heap(), "Set Iterator"), Attribute::Configurable); diff --git a/Userland/Libraries/LibJS/Runtime/SetPrototype.cpp b/Userland/Libraries/LibJS/Runtime/SetPrototype.cpp index 8d701785b2..3dd6e3e13f 100644 --- a/Userland/Libraries/LibJS/Runtime/SetPrototype.cpp +++ b/Userland/Libraries/LibJS/Runtime/SetPrototype.cpp @@ -22,14 +22,14 @@ void SetPrototype::initialize(GlobalObject& global_object) Object::initialize(global_object); u8 attr = Attribute::Writable | Attribute::Configurable; - define_native_function(vm.names.add, add, 1, attr); - define_native_function(vm.names.clear, clear, 0, attr); - define_native_function(vm.names.delete_, delete_, 1, attr); - define_native_function(vm.names.entries, entries, 0, attr); - define_native_function(vm.names.forEach, for_each, 1, attr); - define_native_function(vm.names.has, has, 1, attr); - define_native_function(vm.names.values, values, 0, attr); - define_native_accessor(vm.names.size, size_getter, {}, Attribute::Configurable); + define_old_native_function(vm.names.add, add, 1, attr); + define_old_native_function(vm.names.clear, clear, 0, attr); + define_old_native_function(vm.names.delete_, delete_, 1, attr); + define_old_native_function(vm.names.entries, entries, 0, attr); + define_old_native_function(vm.names.forEach, for_each, 1, attr); + define_old_native_function(vm.names.has, has, 1, attr); + define_old_native_function(vm.names.values, values, 0, attr); + define_old_native_accessor(vm.names.size, size_getter, {}, Attribute::Configurable); define_direct_property(vm.names.keys, get_without_side_effects(vm.names.values), attr); diff --git a/Userland/Libraries/LibJS/Runtime/ShadowRealmPrototype.cpp b/Userland/Libraries/LibJS/Runtime/ShadowRealmPrototype.cpp index 8d3f2d7147..e0dd77bf79 100644 --- a/Userland/Libraries/LibJS/Runtime/ShadowRealmPrototype.cpp +++ b/Userland/Libraries/LibJS/Runtime/ShadowRealmPrototype.cpp @@ -22,8 +22,8 @@ void ShadowRealmPrototype::initialize(GlobalObject& global_object) Object::initialize(global_object); u8 attr = Attribute::Writable | Attribute::Configurable; - define_native_function(vm.names.evaluate, evaluate, 1, attr); - define_native_function(vm.names.importValue, import_value, 2, attr); + define_old_native_function(vm.names.evaluate, evaluate, 1, attr); + define_old_native_function(vm.names.importValue, import_value, 2, attr); // 3.4.3 ShadowRealm.prototype [ @@toStringTag ], https://tc39.es/proposal-shadowrealm/#sec-shadowrealm.prototype-@@tostringtag define_direct_property(*vm.well_known_symbol_to_string_tag(), js_string(vm, vm.names.ShadowRealm.as_string()), Attribute::Configurable); diff --git a/Userland/Libraries/LibJS/Runtime/StringConstructor.cpp b/Userland/Libraries/LibJS/Runtime/StringConstructor.cpp index c035dab703..9c4b5ad5ca 100644 --- a/Userland/Libraries/LibJS/Runtime/StringConstructor.cpp +++ b/Userland/Libraries/LibJS/Runtime/StringConstructor.cpp @@ -31,9 +31,9 @@ void StringConstructor::initialize(GlobalObject& global_object) define_direct_property(vm.names.prototype, global_object.string_prototype(), 0); u8 attr = Attribute::Writable | Attribute::Configurable; - define_native_function(vm.names.raw, raw, 1, attr); - define_native_function(vm.names.fromCharCode, from_char_code, 1, attr); - define_native_function(vm.names.fromCodePoint, from_code_point, 1, attr); + define_old_native_function(vm.names.raw, raw, 1, attr); + define_old_native_function(vm.names.fromCharCode, from_char_code, 1, attr); + define_old_native_function(vm.names.fromCodePoint, from_code_point, 1, attr); define_direct_property(vm.names.length, Value(1), Attribute::Configurable); } diff --git a/Userland/Libraries/LibJS/Runtime/StringIteratorPrototype.cpp b/Userland/Libraries/LibJS/Runtime/StringIteratorPrototype.cpp index f3cf26ce79..47d5effc71 100644 --- a/Userland/Libraries/LibJS/Runtime/StringIteratorPrototype.cpp +++ b/Userland/Libraries/LibJS/Runtime/StringIteratorPrototype.cpp @@ -22,7 +22,7 @@ void StringIteratorPrototype::initialize(GlobalObject& global_object) { auto& vm = this->vm(); Object::initialize(global_object); - define_native_function(vm.names.next, next, 0, Attribute::Configurable | Attribute::Writable); + define_old_native_function(vm.names.next, next, 0, Attribute::Configurable | Attribute::Writable); // 22.1.5.1.2 %StringIteratorPrototype% [ @@toStringTag ], https://tc39.es/ecma262/#sec-%stringiteratorprototype%-@@tostringtag define_direct_property(*vm.well_known_symbol_to_string_tag(), js_string(global_object.heap(), "String Iterator"), Attribute::Configurable); diff --git a/Userland/Libraries/LibJS/Runtime/StringPrototype.cpp b/Userland/Libraries/LibJS/Runtime/StringPrototype.cpp index e454c15de7..855ff30e36 100644 --- a/Userland/Libraries/LibJS/Runtime/StringPrototype.cpp +++ b/Userland/Libraries/LibJS/Runtime/StringPrototype.cpp @@ -110,54 +110,54 @@ void StringPrototype::initialize(GlobalObject& global_object) StringObject::initialize(global_object); u8 attr = Attribute::Writable | Attribute::Configurable; - define_native_function(vm.names.charAt, char_at, 1, attr); - define_native_function(vm.names.charCodeAt, char_code_at, 1, attr); - define_native_function(vm.names.codePointAt, code_point_at, 1, attr); - define_native_function(vm.names.repeat, repeat, 1, attr); - define_native_function(vm.names.startsWith, starts_with, 1, attr); - define_native_function(vm.names.endsWith, ends_with, 1, attr); - define_native_function(vm.names.indexOf, index_of, 1, attr); - define_native_function(vm.names.toLocaleLowerCase, to_locale_lowercase, 0, attr); - define_native_function(vm.names.toLocaleUpperCase, to_locale_uppercase, 0, attr); - define_native_function(vm.names.toLowerCase, to_lowercase, 0, attr); - define_native_function(vm.names.toUpperCase, to_uppercase, 0, attr); - define_native_function(vm.names.toString, to_string, 0, attr); - define_native_function(vm.names.valueOf, value_of, 0, attr); - define_native_function(vm.names.padStart, pad_start, 1, attr); - define_native_function(vm.names.padEnd, pad_end, 1, attr); - define_native_function(vm.names.trim, trim, 0, attr); - define_native_function(vm.names.trimStart, trim_start, 0, attr); + define_old_native_function(vm.names.charAt, char_at, 1, attr); + define_old_native_function(vm.names.charCodeAt, char_code_at, 1, attr); + define_old_native_function(vm.names.codePointAt, code_point_at, 1, attr); + define_old_native_function(vm.names.repeat, repeat, 1, attr); + define_old_native_function(vm.names.startsWith, starts_with, 1, attr); + define_old_native_function(vm.names.endsWith, ends_with, 1, attr); + define_old_native_function(vm.names.indexOf, index_of, 1, attr); + define_old_native_function(vm.names.toLocaleLowerCase, to_locale_lowercase, 0, attr); + define_old_native_function(vm.names.toLocaleUpperCase, to_locale_uppercase, 0, attr); + define_old_native_function(vm.names.toLowerCase, to_lowercase, 0, attr); + define_old_native_function(vm.names.toUpperCase, to_uppercase, 0, attr); + define_old_native_function(vm.names.toString, to_string, 0, attr); + define_old_native_function(vm.names.valueOf, value_of, 0, attr); + define_old_native_function(vm.names.padStart, pad_start, 1, attr); + define_old_native_function(vm.names.padEnd, pad_end, 1, attr); + define_old_native_function(vm.names.trim, trim, 0, attr); + define_old_native_function(vm.names.trimStart, trim_start, 0, attr); define_direct_property(vm.names.trimLeft, get_without_side_effects(vm.names.trimStart), attr); - define_native_function(vm.names.trimEnd, trim_end, 0, attr); + define_old_native_function(vm.names.trimEnd, trim_end, 0, attr); define_direct_property(vm.names.trimRight, get_without_side_effects(vm.names.trimEnd), attr); - define_native_function(vm.names.concat, concat, 1, attr); - define_native_function(vm.names.substr, substr, 2, attr); - define_native_function(vm.names.substring, substring, 2, attr); - define_native_function(vm.names.includes, includes, 1, attr); - define_native_function(vm.names.slice, slice, 2, attr); - define_native_function(vm.names.split, split, 2, attr); - define_native_function(vm.names.lastIndexOf, last_index_of, 1, attr); - define_native_function(vm.names.at, at, 1, attr); - define_native_function(vm.names.match, match, 1, attr); - define_native_function(vm.names.matchAll, match_all, 1, attr); - define_native_function(vm.names.replace, replace, 2, attr); - define_native_function(vm.names.replaceAll, replace_all, 2, attr); - define_native_function(vm.names.search, search, 1, attr); - define_native_function(vm.names.anchor, anchor, 1, attr); - define_native_function(vm.names.big, big, 0, attr); - define_native_function(vm.names.blink, blink, 0, attr); - define_native_function(vm.names.bold, bold, 0, attr); - define_native_function(vm.names.fixed, fixed, 0, attr); - define_native_function(vm.names.fontcolor, fontcolor, 1, attr); - define_native_function(vm.names.fontsize, fontsize, 1, attr); - define_native_function(vm.names.italics, italics, 0, attr); - define_native_function(vm.names.link, link, 1, attr); - define_native_function(vm.names.small, small, 0, attr); - define_native_function(vm.names.strike, strike, 0, attr); - define_native_function(vm.names.sub, sub, 0, attr); - define_native_function(vm.names.sup, sup, 0, attr); - define_native_function(vm.names.localeCompare, locale_compare, 1, attr); - define_native_function(*vm.well_known_symbol_iterator(), symbol_iterator, 0, attr); + define_old_native_function(vm.names.concat, concat, 1, attr); + define_old_native_function(vm.names.substr, substr, 2, attr); + define_old_native_function(vm.names.substring, substring, 2, attr); + define_old_native_function(vm.names.includes, includes, 1, attr); + define_old_native_function(vm.names.slice, slice, 2, attr); + define_old_native_function(vm.names.split, split, 2, attr); + define_old_native_function(vm.names.lastIndexOf, last_index_of, 1, attr); + define_old_native_function(vm.names.at, at, 1, attr); + define_old_native_function(vm.names.match, match, 1, attr); + define_old_native_function(vm.names.matchAll, match_all, 1, attr); + define_old_native_function(vm.names.replace, replace, 2, attr); + define_old_native_function(vm.names.replaceAll, replace_all, 2, attr); + define_old_native_function(vm.names.search, search, 1, attr); + define_old_native_function(vm.names.anchor, anchor, 1, attr); + define_old_native_function(vm.names.big, big, 0, attr); + define_old_native_function(vm.names.blink, blink, 0, attr); + define_old_native_function(vm.names.bold, bold, 0, attr); + define_old_native_function(vm.names.fixed, fixed, 0, attr); + define_old_native_function(vm.names.fontcolor, fontcolor, 1, attr); + define_old_native_function(vm.names.fontsize, fontsize, 1, attr); + define_old_native_function(vm.names.italics, italics, 0, attr); + define_old_native_function(vm.names.link, link, 1, attr); + define_old_native_function(vm.names.small, small, 0, attr); + define_old_native_function(vm.names.strike, strike, 0, attr); + define_old_native_function(vm.names.sub, sub, 0, attr); + define_old_native_function(vm.names.sup, sup, 0, attr); + define_old_native_function(vm.names.localeCompare, locale_compare, 1, attr); + define_old_native_function(*vm.well_known_symbol_iterator(), symbol_iterator, 0, attr); } StringPrototype::~StringPrototype() diff --git a/Userland/Libraries/LibJS/Runtime/SymbolConstructor.cpp b/Userland/Libraries/LibJS/Runtime/SymbolConstructor.cpp index 977bf60f60..b5f4afef12 100644 --- a/Userland/Libraries/LibJS/Runtime/SymbolConstructor.cpp +++ b/Userland/Libraries/LibJS/Runtime/SymbolConstructor.cpp @@ -24,8 +24,8 @@ void SymbolConstructor::initialize(GlobalObject& global_object) define_direct_property(vm.names.prototype, global_object.symbol_prototype(), 0); u8 attr = Attribute::Writable | Attribute::Configurable; - define_native_function(vm.names.for_, for_, 1, attr); - define_native_function(vm.names.keyFor, key_for, 1, attr); + define_old_native_function(vm.names.for_, for_, 1, attr); + define_old_native_function(vm.names.keyFor, key_for, 1, attr); #define __JS_ENUMERATE(SymbolName, snake_name) \ define_direct_property(vm.names.SymbolName, vm.well_known_symbol_##snake_name(), 0); diff --git a/Userland/Libraries/LibJS/Runtime/SymbolPrototype.cpp b/Userland/Libraries/LibJS/Runtime/SymbolPrototype.cpp index 2f4b5b396d..6ca8a12354 100644 --- a/Userland/Libraries/LibJS/Runtime/SymbolPrototype.cpp +++ b/Userland/Libraries/LibJS/Runtime/SymbolPrototype.cpp @@ -28,10 +28,10 @@ void SymbolPrototype::initialize(GlobalObject& global_object) auto& vm = this->vm(); Object::initialize(global_object); u8 attr = Attribute::Writable | Attribute::Configurable; - define_native_function(vm.names.toString, to_string, 0, attr); - define_native_function(vm.names.valueOf, value_of, 0, attr); - define_native_accessor(vm.names.description, description_getter, {}, Attribute::Configurable); - define_native_function(*vm.well_known_symbol_to_primitive(), symbol_to_primitive, 1, Attribute::Configurable); + define_old_native_function(vm.names.toString, to_string, 0, attr); + define_old_native_function(vm.names.valueOf, value_of, 0, attr); + define_old_native_accessor(vm.names.description, description_getter, {}, Attribute::Configurable); + define_old_native_function(*vm.well_known_symbol_to_primitive(), symbol_to_primitive, 1, Attribute::Configurable); // 20.4.3.6 Symbol.prototype [ @@toStringTag ], https://tc39.es/ecma262/#sec-symbol.prototype-@@tostringtag define_direct_property(*vm.well_known_symbol_to_string_tag(), js_string(global_object.heap(), "Symbol"), Attribute::Configurable); diff --git a/Userland/Libraries/LibJS/Runtime/Temporal/CalendarConstructor.cpp b/Userland/Libraries/LibJS/Runtime/Temporal/CalendarConstructor.cpp index 413ae468be..d494236c1e 100644 --- a/Userland/Libraries/LibJS/Runtime/Temporal/CalendarConstructor.cpp +++ b/Userland/Libraries/LibJS/Runtime/Temporal/CalendarConstructor.cpp @@ -26,7 +26,7 @@ void CalendarConstructor::initialize(GlobalObject& global_object) define_direct_property(vm.names.prototype, global_object.temporal_calendar_prototype(), 0); u8 attr = Attribute::Writable | Attribute::Configurable; - define_native_function(vm.names.from, from, 1, attr); + define_old_native_function(vm.names.from, from, 1, attr); define_direct_property(vm.names.length, Value(1), Attribute::Configurable); } diff --git a/Userland/Libraries/LibJS/Runtime/Temporal/CalendarPrototype.cpp b/Userland/Libraries/LibJS/Runtime/Temporal/CalendarPrototype.cpp index 81f7588df3..96333060c0 100644 --- a/Userland/Libraries/LibJS/Runtime/Temporal/CalendarPrototype.cpp +++ b/Userland/Libraries/LibJS/Runtime/Temporal/CalendarPrototype.cpp @@ -34,32 +34,32 @@ void CalendarPrototype::initialize(GlobalObject& global_object) // 12.4.2 Temporal.Calendar.prototype[ @@toStringTag ], https://tc39.es/proposal-temporal/#sec-temporal.calendar.prototype-@@tostringtag define_direct_property(*vm.well_known_symbol_to_string_tag(), js_string(vm, "Temporal.Calendar"), Attribute::Configurable); - define_native_accessor(vm.names.id, id_getter, {}, Attribute::Configurable); + define_old_native_accessor(vm.names.id, id_getter, {}, Attribute::Configurable); u8 attr = Attribute::Writable | Attribute::Configurable; - define_native_function(vm.names.dateFromFields, date_from_fields, 1, attr); - define_native_function(vm.names.yearMonthFromFields, year_month_from_fields, 1, attr); - define_native_function(vm.names.monthDayFromFields, month_day_from_fields, 1, attr); - define_native_function(vm.names.dateAdd, date_add, 2, attr); - define_native_function(vm.names.dateUntil, date_until, 2, attr); - define_native_function(vm.names.year, year, 1, attr); - define_native_function(vm.names.month, month, 1, attr); - define_native_function(vm.names.monthCode, month_code, 1, attr); - define_native_function(vm.names.day, day, 1, attr); - define_native_function(vm.names.dayOfWeek, day_of_week, 1, attr); - define_native_function(vm.names.dayOfYear, day_of_year, 1, attr); - define_native_function(vm.names.weekOfYear, week_of_year, 1, attr); - define_native_function(vm.names.daysInWeek, days_in_week, 1, attr); - define_native_function(vm.names.daysInMonth, days_in_month, 1, attr); - define_native_function(vm.names.daysInYear, days_in_year, 1, attr); - define_native_function(vm.names.monthsInYear, months_in_year, 1, attr); - define_native_function(vm.names.inLeapYear, in_leap_year, 1, attr); - define_native_function(vm.names.fields, fields, 1, attr); - define_native_function(vm.names.mergeFields, merge_fields, 2, attr); - define_native_function(vm.names.toString, to_string, 0, attr); - define_native_function(vm.names.toJSON, to_json, 0, attr); - define_native_function(vm.names.era, era, 1, attr); - define_native_function(vm.names.eraYear, era_year, 1, attr); + define_old_native_function(vm.names.dateFromFields, date_from_fields, 1, attr); + define_old_native_function(vm.names.yearMonthFromFields, year_month_from_fields, 1, attr); + define_old_native_function(vm.names.monthDayFromFields, month_day_from_fields, 1, attr); + define_old_native_function(vm.names.dateAdd, date_add, 2, attr); + define_old_native_function(vm.names.dateUntil, date_until, 2, attr); + define_old_native_function(vm.names.year, year, 1, attr); + define_old_native_function(vm.names.month, month, 1, attr); + define_old_native_function(vm.names.monthCode, month_code, 1, attr); + define_old_native_function(vm.names.day, day, 1, attr); + define_old_native_function(vm.names.dayOfWeek, day_of_week, 1, attr); + define_old_native_function(vm.names.dayOfYear, day_of_year, 1, attr); + define_old_native_function(vm.names.weekOfYear, week_of_year, 1, attr); + define_old_native_function(vm.names.daysInWeek, days_in_week, 1, attr); + define_old_native_function(vm.names.daysInMonth, days_in_month, 1, attr); + define_old_native_function(vm.names.daysInYear, days_in_year, 1, attr); + define_old_native_function(vm.names.monthsInYear, months_in_year, 1, attr); + define_old_native_function(vm.names.inLeapYear, in_leap_year, 1, attr); + define_old_native_function(vm.names.fields, fields, 1, attr); + define_old_native_function(vm.names.mergeFields, merge_fields, 2, attr); + define_old_native_function(vm.names.toString, to_string, 0, attr); + define_old_native_function(vm.names.toJSON, to_json, 0, attr); + define_old_native_function(vm.names.era, era, 1, attr); + define_old_native_function(vm.names.eraYear, era_year, 1, attr); } // 12.4.3 get Temporal.Calendar.prototype.id, https://tc39.es/proposal-temporal/#sec-get-temporal.calendar.prototype.id diff --git a/Userland/Libraries/LibJS/Runtime/Temporal/DurationConstructor.cpp b/Userland/Libraries/LibJS/Runtime/Temporal/DurationConstructor.cpp index 65327db021..d5b52f3203 100644 --- a/Userland/Libraries/LibJS/Runtime/Temporal/DurationConstructor.cpp +++ b/Userland/Libraries/LibJS/Runtime/Temporal/DurationConstructor.cpp @@ -28,7 +28,7 @@ void DurationConstructor::initialize(GlobalObject& global_object) define_direct_property(vm.names.prototype, global_object.temporal_duration_prototype(), 0); u8 attr = Attribute::Writable | Attribute::Configurable; - define_native_function(vm.names.from, from, 1, attr); + define_old_native_function(vm.names.from, from, 1, attr); define_direct_property(vm.names.length, Value(0), Attribute::Configurable); } diff --git a/Userland/Libraries/LibJS/Runtime/Temporal/DurationPrototype.cpp b/Userland/Libraries/LibJS/Runtime/Temporal/DurationPrototype.cpp index 0540a2d221..8c27e90281 100644 --- a/Userland/Libraries/LibJS/Runtime/Temporal/DurationPrototype.cpp +++ b/Userland/Libraries/LibJS/Runtime/Temporal/DurationPrototype.cpp @@ -27,24 +27,24 @@ void DurationPrototype::initialize(GlobalObject& global_object) // 7.3.2 Temporal.Duration.prototype[ @@toStringTag ], https://tc39.es/proposal-temporal/#sec-temporal.duration.prototype-@@tostringtag define_direct_property(*vm.well_known_symbol_to_string_tag(), js_string(vm, "Temporal.Duration"), Attribute::Configurable); - define_native_accessor(vm.names.years, years_getter, {}, Attribute::Configurable); - define_native_accessor(vm.names.months, months_getter, {}, Attribute::Configurable); - define_native_accessor(vm.names.weeks, weeks_getter, {}, Attribute::Configurable); - define_native_accessor(vm.names.days, days_getter, {}, Attribute::Configurable); - define_native_accessor(vm.names.hours, hours_getter, {}, Attribute::Configurable); - define_native_accessor(vm.names.minutes, minutes_getter, {}, Attribute::Configurable); - define_native_accessor(vm.names.seconds, seconds_getter, {}, Attribute::Configurable); - define_native_accessor(vm.names.milliseconds, milliseconds_getter, {}, Attribute::Configurable); - define_native_accessor(vm.names.microseconds, microseconds_getter, {}, Attribute::Configurable); - define_native_accessor(vm.names.nanoseconds, nanoseconds_getter, {}, Attribute::Configurable); - define_native_accessor(vm.names.sign, sign_getter, {}, Attribute::Configurable); - define_native_accessor(vm.names.blank, blank_getter, {}, Attribute::Configurable); + define_old_native_accessor(vm.names.years, years_getter, {}, Attribute::Configurable); + define_old_native_accessor(vm.names.months, months_getter, {}, Attribute::Configurable); + define_old_native_accessor(vm.names.weeks, weeks_getter, {}, Attribute::Configurable); + define_old_native_accessor(vm.names.days, days_getter, {}, Attribute::Configurable); + define_old_native_accessor(vm.names.hours, hours_getter, {}, Attribute::Configurable); + define_old_native_accessor(vm.names.minutes, minutes_getter, {}, Attribute::Configurable); + define_old_native_accessor(vm.names.seconds, seconds_getter, {}, Attribute::Configurable); + define_old_native_accessor(vm.names.milliseconds, milliseconds_getter, {}, Attribute::Configurable); + define_old_native_accessor(vm.names.microseconds, microseconds_getter, {}, Attribute::Configurable); + define_old_native_accessor(vm.names.nanoseconds, nanoseconds_getter, {}, Attribute::Configurable); + define_old_native_accessor(vm.names.sign, sign_getter, {}, Attribute::Configurable); + define_old_native_accessor(vm.names.blank, blank_getter, {}, Attribute::Configurable); u8 attr = Attribute::Writable | Attribute::Configurable; - define_native_function(vm.names.with, with, 1, attr); - define_native_function(vm.names.negated, negated, 0, attr); - define_native_function(vm.names.abs, abs, 0, attr); - define_native_function(vm.names.valueOf, value_of, 0, attr); + define_old_native_function(vm.names.with, with, 1, attr); + define_old_native_function(vm.names.negated, negated, 0, attr); + define_old_native_function(vm.names.abs, abs, 0, attr); + define_old_native_function(vm.names.valueOf, value_of, 0, attr); } // 7.3.3 get Temporal.Duration.prototype.years, https://tc39.es/proposal-temporal/#sec-get-temporal.duration.prototype.years diff --git a/Userland/Libraries/LibJS/Runtime/Temporal/InstantConstructor.cpp b/Userland/Libraries/LibJS/Runtime/Temporal/InstantConstructor.cpp index f2b0e56cf2..2e40a4bf35 100644 --- a/Userland/Libraries/LibJS/Runtime/Temporal/InstantConstructor.cpp +++ b/Userland/Libraries/LibJS/Runtime/Temporal/InstantConstructor.cpp @@ -28,12 +28,12 @@ void InstantConstructor::initialize(GlobalObject& global_object) define_direct_property(vm.names.prototype, global_object.temporal_instant_prototype(), 0); u8 attr = Attribute::Writable | Attribute::Configurable; - define_native_function(vm.names.from, from, 1, attr); - define_native_function(vm.names.fromEpochSeconds, from_epoch_seconds, 1, attr); - define_native_function(vm.names.fromEpochMilliseconds, from_epoch_milliseconds, 1, attr); - define_native_function(vm.names.fromEpochMicroseconds, from_epoch_microseconds, 1, attr); - define_native_function(vm.names.fromEpochNanoseconds, from_epoch_nanoseconds, 1, attr); - define_native_function(vm.names.compare, compare, 2, attr); + define_old_native_function(vm.names.from, from, 1, attr); + define_old_native_function(vm.names.fromEpochSeconds, from_epoch_seconds, 1, attr); + define_old_native_function(vm.names.fromEpochMilliseconds, from_epoch_milliseconds, 1, attr); + define_old_native_function(vm.names.fromEpochMicroseconds, from_epoch_microseconds, 1, attr); + define_old_native_function(vm.names.fromEpochNanoseconds, from_epoch_nanoseconds, 1, attr); + define_old_native_function(vm.names.compare, compare, 2, attr); define_direct_property(vm.names.length, Value(1), Attribute::Configurable); } diff --git a/Userland/Libraries/LibJS/Runtime/Temporal/InstantPrototype.cpp b/Userland/Libraries/LibJS/Runtime/Temporal/InstantPrototype.cpp index 4c300266f2..b5f59b28a3 100644 --- a/Userland/Libraries/LibJS/Runtime/Temporal/InstantPrototype.cpp +++ b/Userland/Libraries/LibJS/Runtime/Temporal/InstantPrototype.cpp @@ -32,24 +32,24 @@ void InstantPrototype::initialize(GlobalObject& global_object) // 8.3.2 Temporal.Instant.prototype[ @@toStringTag ], https://tc39.es/proposal-temporal/#sec-temporal.instant.prototype-@@tostringtag define_direct_property(*vm.well_known_symbol_to_string_tag(), js_string(vm, "Temporal.Instant"), Attribute::Configurable); - define_native_accessor(vm.names.epochSeconds, epoch_seconds_getter, {}, Attribute::Configurable); - define_native_accessor(vm.names.epochMilliseconds, epoch_milliseconds_getter, {}, Attribute::Configurable); - define_native_accessor(vm.names.epochMicroseconds, epoch_microseconds_getter, {}, Attribute::Configurable); - define_native_accessor(vm.names.epochNanoseconds, epoch_nanoseconds_getter, {}, Attribute::Configurable); + define_old_native_accessor(vm.names.epochSeconds, epoch_seconds_getter, {}, Attribute::Configurable); + define_old_native_accessor(vm.names.epochMilliseconds, epoch_milliseconds_getter, {}, Attribute::Configurable); + define_old_native_accessor(vm.names.epochMicroseconds, epoch_microseconds_getter, {}, Attribute::Configurable); + define_old_native_accessor(vm.names.epochNanoseconds, epoch_nanoseconds_getter, {}, Attribute::Configurable); u8 attr = Attribute::Writable | Attribute::Configurable; - define_native_function(vm.names.add, add, 1, attr); - define_native_function(vm.names.subtract, subtract, 1, attr); - define_native_function(vm.names.until, until, 1, attr); - define_native_function(vm.names.since, since, 1, attr); - define_native_function(vm.names.round, round, 1, attr); - define_native_function(vm.names.equals, equals, 1, attr); - define_native_function(vm.names.toString, to_string, 0, attr); - define_native_function(vm.names.toLocaleString, to_locale_string, 0, attr); - define_native_function(vm.names.toJSON, to_json, 0, attr); - define_native_function(vm.names.valueOf, value_of, 0, attr); - define_native_function(vm.names.toZonedDateTime, to_zoned_date_time, 1, attr); - define_native_function(vm.names.toZonedDateTimeISO, to_zoned_date_time_iso, 1, attr); + define_old_native_function(vm.names.add, add, 1, attr); + define_old_native_function(vm.names.subtract, subtract, 1, attr); + define_old_native_function(vm.names.until, until, 1, attr); + define_old_native_function(vm.names.since, since, 1, attr); + define_old_native_function(vm.names.round, round, 1, attr); + define_old_native_function(vm.names.equals, equals, 1, attr); + define_old_native_function(vm.names.toString, to_string, 0, attr); + define_old_native_function(vm.names.toLocaleString, to_locale_string, 0, attr); + define_old_native_function(vm.names.toJSON, to_json, 0, attr); + define_old_native_function(vm.names.valueOf, value_of, 0, attr); + define_old_native_function(vm.names.toZonedDateTime, to_zoned_date_time, 1, attr); + define_old_native_function(vm.names.toZonedDateTimeISO, to_zoned_date_time_iso, 1, attr); } // 8.3.3 get Temporal.Instant.prototype.epochSeconds, https://tc39.es/proposal-temporal/#sec-get-temporal.instant.prototype.epochseconds diff --git a/Userland/Libraries/LibJS/Runtime/Temporal/Now.cpp b/Userland/Libraries/LibJS/Runtime/Temporal/Now.cpp index 72ac3fe013..51b91a0495 100644 --- a/Userland/Libraries/LibJS/Runtime/Temporal/Now.cpp +++ b/Userland/Libraries/LibJS/Runtime/Temporal/Now.cpp @@ -35,15 +35,15 @@ void Now::initialize(GlobalObject& global_object) define_direct_property(*vm.well_known_symbol_to_string_tag(), js_string(vm, "Temporal.Now"), Attribute::Configurable); u8 attr = Attribute::Writable | Attribute::Configurable; - define_native_function(vm.names.timeZone, time_zone, 0, attr); - define_native_function(vm.names.instant, instant, 0, attr); - define_native_function(vm.names.plainDateTime, plain_date_time, 1, attr); - define_native_function(vm.names.plainDateTimeISO, plain_date_time_iso, 0, attr); - define_native_function(vm.names.zonedDateTime, zoned_date_time, 1, attr); - define_native_function(vm.names.zonedDateTimeISO, zoned_date_time_iso, 0, attr); - define_native_function(vm.names.plainDate, plain_date, 1, attr); - define_native_function(vm.names.plainDateISO, plain_date_iso, 0, attr); - define_native_function(vm.names.plainTimeISO, plain_time_iso, 0, attr); + define_old_native_function(vm.names.timeZone, time_zone, 0, attr); + define_old_native_function(vm.names.instant, instant, 0, attr); + define_old_native_function(vm.names.plainDateTime, plain_date_time, 1, attr); + define_old_native_function(vm.names.plainDateTimeISO, plain_date_time_iso, 0, attr); + define_old_native_function(vm.names.zonedDateTime, zoned_date_time, 1, attr); + define_old_native_function(vm.names.zonedDateTimeISO, zoned_date_time_iso, 0, attr); + define_old_native_function(vm.names.plainDate, plain_date, 1, attr); + define_old_native_function(vm.names.plainDateISO, plain_date_iso, 0, attr); + define_old_native_function(vm.names.plainTimeISO, plain_time_iso, 0, attr); } // 2.2.1 Temporal.Now.timeZone ( ), https://tc39.es/proposal-temporal/#sec-temporal.now.timezone diff --git a/Userland/Libraries/LibJS/Runtime/Temporal/PlainDateConstructor.cpp b/Userland/Libraries/LibJS/Runtime/Temporal/PlainDateConstructor.cpp index 2cb9abe87f..4ffd49a4c0 100644 --- a/Userland/Libraries/LibJS/Runtime/Temporal/PlainDateConstructor.cpp +++ b/Userland/Libraries/LibJS/Runtime/Temporal/PlainDateConstructor.cpp @@ -30,8 +30,8 @@ void PlainDateConstructor::initialize(GlobalObject& global_object) define_direct_property(vm.names.prototype, global_object.temporal_plain_date_prototype(), 0); u8 attr = Attribute::Writable | Attribute::Configurable; - define_native_function(vm.names.from, from, 1, attr); - define_native_function(vm.names.compare, compare, 2, attr); + define_old_native_function(vm.names.from, from, 1, attr); + define_old_native_function(vm.names.compare, compare, 2, attr); define_direct_property(vm.names.length, Value(3), Attribute::Configurable); } diff --git a/Userland/Libraries/LibJS/Runtime/Temporal/PlainDatePrototype.cpp b/Userland/Libraries/LibJS/Runtime/Temporal/PlainDatePrototype.cpp index c3792c5236..55a9be6366 100644 --- a/Userland/Libraries/LibJS/Runtime/Temporal/PlainDatePrototype.cpp +++ b/Userland/Libraries/LibJS/Runtime/Temporal/PlainDatePrototype.cpp @@ -33,33 +33,33 @@ void PlainDatePrototype::initialize(GlobalObject& global_object) // 3.3.2 Temporal.PlainDate.prototype[ @@toStringTag ], https://tc39.es/proposal-temporal/#sec-temporal.plaindate.prototype-@@tostringtag define_direct_property(*vm.well_known_symbol_to_string_tag(), js_string(vm, "Temporal.PlainDate"), Attribute::Configurable); - define_native_accessor(vm.names.calendar, calendar_getter, {}, Attribute::Configurable); - define_native_accessor(vm.names.year, year_getter, {}, Attribute::Configurable); - define_native_accessor(vm.names.month, month_getter, {}, Attribute::Configurable); - define_native_accessor(vm.names.monthCode, month_code_getter, {}, Attribute::Configurable); - define_native_accessor(vm.names.day, day_getter, {}, Attribute::Configurable); - define_native_accessor(vm.names.dayOfWeek, day_of_week_getter, {}, Attribute::Configurable); - define_native_accessor(vm.names.dayOfYear, day_of_year_getter, {}, Attribute::Configurable); - define_native_accessor(vm.names.weekOfYear, week_of_year_getter, {}, Attribute::Configurable); - define_native_accessor(vm.names.daysInWeek, days_in_week_getter, {}, Attribute::Configurable); - define_native_accessor(vm.names.daysInMonth, days_in_month_getter, {}, Attribute::Configurable); - define_native_accessor(vm.names.daysInYear, days_in_year_getter, {}, Attribute::Configurable); - define_native_accessor(vm.names.monthsInYear, months_in_year_getter, {}, Attribute::Configurable); - define_native_accessor(vm.names.inLeapYear, in_leap_year_getter, {}, Attribute::Configurable); - define_native_accessor(vm.names.era, era_getter, {}, Attribute::Configurable); - define_native_accessor(vm.names.eraYear, era_year_getter, {}, Attribute::Configurable); + define_old_native_accessor(vm.names.calendar, calendar_getter, {}, Attribute::Configurable); + define_old_native_accessor(vm.names.year, year_getter, {}, Attribute::Configurable); + define_old_native_accessor(vm.names.month, month_getter, {}, Attribute::Configurable); + define_old_native_accessor(vm.names.monthCode, month_code_getter, {}, Attribute::Configurable); + define_old_native_accessor(vm.names.day, day_getter, {}, Attribute::Configurable); + define_old_native_accessor(vm.names.dayOfWeek, day_of_week_getter, {}, Attribute::Configurable); + define_old_native_accessor(vm.names.dayOfYear, day_of_year_getter, {}, Attribute::Configurable); + define_old_native_accessor(vm.names.weekOfYear, week_of_year_getter, {}, Attribute::Configurable); + define_old_native_accessor(vm.names.daysInWeek, days_in_week_getter, {}, Attribute::Configurable); + define_old_native_accessor(vm.names.daysInMonth, days_in_month_getter, {}, Attribute::Configurable); + define_old_native_accessor(vm.names.daysInYear, days_in_year_getter, {}, Attribute::Configurable); + define_old_native_accessor(vm.names.monthsInYear, months_in_year_getter, {}, Attribute::Configurable); + define_old_native_accessor(vm.names.inLeapYear, in_leap_year_getter, {}, Attribute::Configurable); + define_old_native_accessor(vm.names.era, era_getter, {}, Attribute::Configurable); + define_old_native_accessor(vm.names.eraYear, era_year_getter, {}, Attribute::Configurable); u8 attr = Attribute::Writable | Attribute::Configurable; - define_native_function(vm.names.toPlainYearMonth, to_plain_year_month, 0, attr); - define_native_function(vm.names.toPlainMonthDay, to_plain_month_day, 0, attr); - define_native_function(vm.names.getISOFields, get_iso_fields, 0, attr); - define_native_function(vm.names.withCalendar, with_calendar, 1, attr); - define_native_function(vm.names.equals, equals, 1, attr); - define_native_function(vm.names.toPlainDateTime, to_plain_date_time, 0, attr); - define_native_function(vm.names.toString, to_string, 0, attr); - define_native_function(vm.names.toLocaleString, to_locale_string, 0, attr); - define_native_function(vm.names.toJSON, to_json, 0, attr); - define_native_function(vm.names.valueOf, value_of, 0, attr); + define_old_native_function(vm.names.toPlainYearMonth, to_plain_year_month, 0, attr); + define_old_native_function(vm.names.toPlainMonthDay, to_plain_month_day, 0, attr); + define_old_native_function(vm.names.getISOFields, get_iso_fields, 0, attr); + define_old_native_function(vm.names.withCalendar, with_calendar, 1, attr); + define_old_native_function(vm.names.equals, equals, 1, attr); + define_old_native_function(vm.names.toPlainDateTime, to_plain_date_time, 0, attr); + define_old_native_function(vm.names.toString, to_string, 0, attr); + define_old_native_function(vm.names.toLocaleString, to_locale_string, 0, attr); + define_old_native_function(vm.names.toJSON, to_json, 0, attr); + define_old_native_function(vm.names.valueOf, value_of, 0, attr); } // 3.3.3 get Temporal.PlainDate.prototype.calendar, https://tc39.es/proposal-temporal/#sec-get-temporal.plaindate.prototype.calendar diff --git a/Userland/Libraries/LibJS/Runtime/Temporal/PlainDateTimeConstructor.cpp b/Userland/Libraries/LibJS/Runtime/Temporal/PlainDateTimeConstructor.cpp index 7f2e588201..ebd70a63f4 100644 --- a/Userland/Libraries/LibJS/Runtime/Temporal/PlainDateTimeConstructor.cpp +++ b/Userland/Libraries/LibJS/Runtime/Temporal/PlainDateTimeConstructor.cpp @@ -30,8 +30,8 @@ void PlainDateTimeConstructor::initialize(GlobalObject& global_object) define_direct_property(vm.names.prototype, global_object.temporal_plain_date_time_prototype(), 0); u8 attr = Attribute::Writable | Attribute::Configurable; - define_native_function(vm.names.from, from, 1, attr); - define_native_function(vm.names.compare, compare, 2, attr); + define_old_native_function(vm.names.from, from, 1, attr); + define_old_native_function(vm.names.compare, compare, 2, attr); define_direct_property(vm.names.length, Value(3), Attribute::Configurable); } diff --git a/Userland/Libraries/LibJS/Runtime/Temporal/PlainDateTimePrototype.cpp b/Userland/Libraries/LibJS/Runtime/Temporal/PlainDateTimePrototype.cpp index 89d691d304..bdb5fb2491 100644 --- a/Userland/Libraries/LibJS/Runtime/Temporal/PlainDateTimePrototype.cpp +++ b/Userland/Libraries/LibJS/Runtime/Temporal/PlainDateTimePrototype.cpp @@ -30,39 +30,39 @@ void PlainDateTimePrototype::initialize(GlobalObject& global_object) // 5.3.2 Temporal.PlainDateTime.prototype[ @@toStringTag ], https://tc39.es/proposal-temporal/#sec-temporal.plaindatetime.prototype-@@tostringtag define_direct_property(*vm.well_known_symbol_to_string_tag(), js_string(vm, "Temporal.PlainDateTime"), Attribute::Configurable); - define_native_accessor(vm.names.calendar, calendar_getter, {}, Attribute::Configurable); - define_native_accessor(vm.names.year, year_getter, {}, Attribute::Configurable); - define_native_accessor(vm.names.month, month_getter, {}, Attribute::Configurable); - define_native_accessor(vm.names.monthCode, month_code_getter, {}, Attribute::Configurable); - define_native_accessor(vm.names.day, day_getter, {}, Attribute::Configurable); - define_native_accessor(vm.names.hour, hour_getter, {}, Attribute::Configurable); - define_native_accessor(vm.names.minute, minute_getter, {}, Attribute::Configurable); - define_native_accessor(vm.names.second, second_getter, {}, Attribute::Configurable); - define_native_accessor(vm.names.millisecond, millisecond_getter, {}, Attribute::Configurable); - define_native_accessor(vm.names.microsecond, microsecond_getter, {}, Attribute::Configurable); - define_native_accessor(vm.names.nanosecond, nanosecond_getter, {}, Attribute::Configurable); - define_native_accessor(vm.names.dayOfWeek, day_of_week_getter, {}, Attribute::Configurable); - define_native_accessor(vm.names.dayOfYear, day_of_year_getter, {}, Attribute::Configurable); - define_native_accessor(vm.names.weekOfYear, week_of_year_getter, {}, Attribute::Configurable); - define_native_accessor(vm.names.daysInWeek, days_in_week_getter, {}, Attribute::Configurable); - define_native_accessor(vm.names.daysInMonth, days_in_month_getter, {}, Attribute::Configurable); - define_native_accessor(vm.names.daysInYear, days_in_year_getter, {}, Attribute::Configurable); - define_native_accessor(vm.names.monthsInYear, months_in_year_getter, {}, Attribute::Configurable); - define_native_accessor(vm.names.inLeapYear, in_leap_year_getter, {}, Attribute::Configurable); - define_native_accessor(vm.names.era, era_getter, {}, Attribute::Configurable); - define_native_accessor(vm.names.eraYear, era_year_getter, {}, Attribute::Configurable); + define_old_native_accessor(vm.names.calendar, calendar_getter, {}, Attribute::Configurable); + define_old_native_accessor(vm.names.year, year_getter, {}, Attribute::Configurable); + define_old_native_accessor(vm.names.month, month_getter, {}, Attribute::Configurable); + define_old_native_accessor(vm.names.monthCode, month_code_getter, {}, Attribute::Configurable); + define_old_native_accessor(vm.names.day, day_getter, {}, Attribute::Configurable); + define_old_native_accessor(vm.names.hour, hour_getter, {}, Attribute::Configurable); + define_old_native_accessor(vm.names.minute, minute_getter, {}, Attribute::Configurable); + define_old_native_accessor(vm.names.second, second_getter, {}, Attribute::Configurable); + define_old_native_accessor(vm.names.millisecond, millisecond_getter, {}, Attribute::Configurable); + define_old_native_accessor(vm.names.microsecond, microsecond_getter, {}, Attribute::Configurable); + define_old_native_accessor(vm.names.nanosecond, nanosecond_getter, {}, Attribute::Configurable); + define_old_native_accessor(vm.names.dayOfWeek, day_of_week_getter, {}, Attribute::Configurable); + define_old_native_accessor(vm.names.dayOfYear, day_of_year_getter, {}, Attribute::Configurable); + define_old_native_accessor(vm.names.weekOfYear, week_of_year_getter, {}, Attribute::Configurable); + define_old_native_accessor(vm.names.daysInWeek, days_in_week_getter, {}, Attribute::Configurable); + define_old_native_accessor(vm.names.daysInMonth, days_in_month_getter, {}, Attribute::Configurable); + define_old_native_accessor(vm.names.daysInYear, days_in_year_getter, {}, Attribute::Configurable); + define_old_native_accessor(vm.names.monthsInYear, months_in_year_getter, {}, Attribute::Configurable); + define_old_native_accessor(vm.names.inLeapYear, in_leap_year_getter, {}, Attribute::Configurable); + define_old_native_accessor(vm.names.era, era_getter, {}, Attribute::Configurable); + define_old_native_accessor(vm.names.eraYear, era_year_getter, {}, Attribute::Configurable); u8 attr = Attribute::Writable | Attribute::Configurable; - define_native_function(vm.names.withPlainTime, with_plain_time, 1, attr); - define_native_function(vm.names.withPlainDate, with_plain_date, 1, attr); - define_native_function(vm.names.withCalendar, with_calendar, 1, attr); - define_native_function(vm.names.equals, equals, 1, attr); - define_native_function(vm.names.valueOf, value_of, 0, attr); - define_native_function(vm.names.toPlainDate, to_plain_date, 0, attr); - define_native_function(vm.names.toPlainYearMonth, to_plain_year_month, 0, attr); - define_native_function(vm.names.toPlainMonthDay, to_plain_month_day, 0, attr); - define_native_function(vm.names.toPlainTime, to_plain_time, 0, attr); - define_native_function(vm.names.getISOFields, get_iso_fields, 0, attr); + define_old_native_function(vm.names.withPlainTime, with_plain_time, 1, attr); + define_old_native_function(vm.names.withPlainDate, with_plain_date, 1, attr); + define_old_native_function(vm.names.withCalendar, with_calendar, 1, attr); + define_old_native_function(vm.names.equals, equals, 1, attr); + define_old_native_function(vm.names.valueOf, value_of, 0, attr); + define_old_native_function(vm.names.toPlainDate, to_plain_date, 0, attr); + define_old_native_function(vm.names.toPlainYearMonth, to_plain_year_month, 0, attr); + define_old_native_function(vm.names.toPlainMonthDay, to_plain_month_day, 0, attr); + define_old_native_function(vm.names.toPlainTime, to_plain_time, 0, attr); + define_old_native_function(vm.names.getISOFields, get_iso_fields, 0, attr); } // 5.3.3 get Temporal.PlainDateTime.prototype.calendar, https://tc39.es/proposal-temporal/#sec-get-temporal.plaindatetime.prototype.calendar diff --git a/Userland/Libraries/LibJS/Runtime/Temporal/PlainMonthDayConstructor.cpp b/Userland/Libraries/LibJS/Runtime/Temporal/PlainMonthDayConstructor.cpp index 349ea2fd12..fa6fdfb355 100644 --- a/Userland/Libraries/LibJS/Runtime/Temporal/PlainMonthDayConstructor.cpp +++ b/Userland/Libraries/LibJS/Runtime/Temporal/PlainMonthDayConstructor.cpp @@ -31,7 +31,7 @@ void PlainMonthDayConstructor::initialize(GlobalObject& global_object) define_direct_property(vm.names.length, Value(2), Attribute::Configurable); u8 attr = Attribute::Writable | Attribute::Configurable; - define_native_function(vm.names.from, from, 1, attr); + define_old_native_function(vm.names.from, from, 1, attr); } // 10.1.1 Temporal.PlainMonthDay ( isoMonth, isoDay [ , calendarLike [ , referenceISOYear ] ] ), https://tc39.es/proposal-temporal/#sec-temporal.plainmonthday diff --git a/Userland/Libraries/LibJS/Runtime/Temporal/PlainMonthDayPrototype.cpp b/Userland/Libraries/LibJS/Runtime/Temporal/PlainMonthDayPrototype.cpp index 867917d336..78bd1bd7fe 100644 --- a/Userland/Libraries/LibJS/Runtime/Temporal/PlainMonthDayPrototype.cpp +++ b/Userland/Libraries/LibJS/Runtime/Temporal/PlainMonthDayPrototype.cpp @@ -28,18 +28,18 @@ void PlainMonthDayPrototype::initialize(GlobalObject& global_object) // 10.3.2 Temporal.PlainMonthDay.prototype[ @@toStringTag ], https://tc39.es/proposal-temporal/#sec-temporal.plainmonthday.prototype-@@tostringtag define_direct_property(*vm.well_known_symbol_to_string_tag(), js_string(vm, "Temporal.PlainMonthDay"), Attribute::Configurable); - define_native_accessor(vm.names.calendar, calendar_getter, {}, Attribute::Configurable); - define_native_accessor(vm.names.monthCode, month_code_getter, {}, Attribute::Configurable); - define_native_accessor(vm.names.day, day_getter, {}, Attribute::Configurable); + define_old_native_accessor(vm.names.calendar, calendar_getter, {}, Attribute::Configurable); + define_old_native_accessor(vm.names.monthCode, month_code_getter, {}, Attribute::Configurable); + define_old_native_accessor(vm.names.day, day_getter, {}, Attribute::Configurable); u8 attr = Attribute::Writable | Attribute::Configurable; - define_native_function(vm.names.equals, equals, 1, attr); - define_native_function(vm.names.toString, to_string, 0, attr); - define_native_function(vm.names.toLocaleString, to_locale_string, 0, attr); - define_native_function(vm.names.toJSON, to_json, 0, attr); - define_native_function(vm.names.valueOf, value_of, 0, attr); - define_native_function(vm.names.toPlainDate, to_plain_date, 1, attr); - define_native_function(vm.names.getISOFields, get_iso_fields, 0, attr); + define_old_native_function(vm.names.equals, equals, 1, attr); + define_old_native_function(vm.names.toString, to_string, 0, attr); + define_old_native_function(vm.names.toLocaleString, to_locale_string, 0, attr); + define_old_native_function(vm.names.toJSON, to_json, 0, attr); + define_old_native_function(vm.names.valueOf, value_of, 0, attr); + define_old_native_function(vm.names.toPlainDate, to_plain_date, 1, attr); + define_old_native_function(vm.names.getISOFields, get_iso_fields, 0, attr); } // 10.3.3 get Temporal.PlainMonthDay.prototype.calendar, https://tc39.es/proposal-temporal/#sec-get-temporal.plainmonthday.prototype.calendar diff --git a/Userland/Libraries/LibJS/Runtime/Temporal/PlainTimeConstructor.cpp b/Userland/Libraries/LibJS/Runtime/Temporal/PlainTimeConstructor.cpp index 203fae1a21..473eeb8dcc 100644 --- a/Userland/Libraries/LibJS/Runtime/Temporal/PlainTimeConstructor.cpp +++ b/Userland/Libraries/LibJS/Runtime/Temporal/PlainTimeConstructor.cpp @@ -28,8 +28,8 @@ void PlainTimeConstructor::initialize(GlobalObject& global_object) define_direct_property(vm.names.prototype, global_object.temporal_plain_time_prototype(), 0); u8 attr = Attribute::Writable | Attribute::Configurable; - define_native_function(vm.names.from, from, 1, attr); - define_native_function(vm.names.compare, compare, 2, attr); + define_old_native_function(vm.names.from, from, 1, attr); + define_old_native_function(vm.names.compare, compare, 2, attr); define_direct_property(vm.names.length, Value(0), Attribute::Configurable); } diff --git a/Userland/Libraries/LibJS/Runtime/Temporal/PlainTimePrototype.cpp b/Userland/Libraries/LibJS/Runtime/Temporal/PlainTimePrototype.cpp index e9596e41fd..2ee828e917 100644 --- a/Userland/Libraries/LibJS/Runtime/Temporal/PlainTimePrototype.cpp +++ b/Userland/Libraries/LibJS/Runtime/Temporal/PlainTimePrototype.cpp @@ -29,23 +29,23 @@ void PlainTimePrototype::initialize(GlobalObject& global_object) // 4.3.2 Temporal.PlainTime.prototype[ @@toStringTag ], https://tc39.es/proposal-temporal/#sec-temporal.plaintime.prototype-@@tostringtag define_direct_property(*vm.well_known_symbol_to_string_tag(), js_string(vm, "Temporal.PlainTime"), Attribute::Configurable); - define_native_accessor(vm.names.calendar, calendar_getter, {}, Attribute::Configurable); - define_native_accessor(vm.names.hour, hour_getter, {}, Attribute::Configurable); - define_native_accessor(vm.names.minute, minute_getter, {}, Attribute::Configurable); - define_native_accessor(vm.names.second, second_getter, {}, Attribute::Configurable); - define_native_accessor(vm.names.millisecond, millisecond_getter, {}, Attribute::Configurable); - define_native_accessor(vm.names.microsecond, microsecond_getter, {}, Attribute::Configurable); - define_native_accessor(vm.names.nanosecond, nanosecond_getter, {}, Attribute::Configurable); + define_old_native_accessor(vm.names.calendar, calendar_getter, {}, Attribute::Configurable); + define_old_native_accessor(vm.names.hour, hour_getter, {}, Attribute::Configurable); + define_old_native_accessor(vm.names.minute, minute_getter, {}, Attribute::Configurable); + define_old_native_accessor(vm.names.second, second_getter, {}, Attribute::Configurable); + define_old_native_accessor(vm.names.millisecond, millisecond_getter, {}, Attribute::Configurable); + define_old_native_accessor(vm.names.microsecond, microsecond_getter, {}, Attribute::Configurable); + define_old_native_accessor(vm.names.nanosecond, nanosecond_getter, {}, Attribute::Configurable); u8 attr = Attribute::Writable | Attribute::Configurable; - define_native_function(vm.names.with, with, 1, attr); - define_native_function(vm.names.equals, equals, 1, attr); - define_native_function(vm.names.toPlainDateTime, to_plain_date_time, 1, attr); - define_native_function(vm.names.getISOFields, get_iso_fields, 0, attr); - define_native_function(vm.names.toString, to_string, 0, attr); - define_native_function(vm.names.toLocaleString, to_locale_string, 0, attr); - define_native_function(vm.names.toJSON, to_json, 0, attr); - define_native_function(vm.names.valueOf, value_of, 0, attr); + define_old_native_function(vm.names.with, with, 1, attr); + define_old_native_function(vm.names.equals, equals, 1, attr); + define_old_native_function(vm.names.toPlainDateTime, to_plain_date_time, 1, attr); + define_old_native_function(vm.names.getISOFields, get_iso_fields, 0, attr); + define_old_native_function(vm.names.toString, to_string, 0, attr); + define_old_native_function(vm.names.toLocaleString, to_locale_string, 0, attr); + define_old_native_function(vm.names.toJSON, to_json, 0, attr); + define_old_native_function(vm.names.valueOf, value_of, 0, attr); } // 4.3.3 get Temporal.PlainTime.prototype.calendar, https://tc39.es/proposal-temporal/#sec-get-temporal.plaintime.prototype.calendar diff --git a/Userland/Libraries/LibJS/Runtime/Temporal/PlainYearMonthConstructor.cpp b/Userland/Libraries/LibJS/Runtime/Temporal/PlainYearMonthConstructor.cpp index 3f2548c308..4effdeb95a 100644 --- a/Userland/Libraries/LibJS/Runtime/Temporal/PlainYearMonthConstructor.cpp +++ b/Userland/Libraries/LibJS/Runtime/Temporal/PlainYearMonthConstructor.cpp @@ -32,8 +32,8 @@ void PlainYearMonthConstructor::initialize(GlobalObject& global_object) define_direct_property(vm.names.length, Value(2), Attribute::Configurable); u8 attr = Attribute::Writable | Attribute::Configurable; - define_native_function(vm.names.from, from, 1, attr); - define_native_function(vm.names.compare, compare, 2, attr); + define_old_native_function(vm.names.from, from, 1, attr); + define_old_native_function(vm.names.compare, compare, 2, attr); } // 9.1.1 Temporal.PlainYearMonth ( isoYear, isoMonth [ , calendarLike [ , referenceISODay ] ] ), https://tc39.es/proposal-temporal/#sec-temporal.plainyearmonth diff --git a/Userland/Libraries/LibJS/Runtime/Temporal/PlainYearMonthPrototype.cpp b/Userland/Libraries/LibJS/Runtime/Temporal/PlainYearMonthPrototype.cpp index 5755bd0132..cf79b2a5aa 100644 --- a/Userland/Libraries/LibJS/Runtime/Temporal/PlainYearMonthPrototype.cpp +++ b/Userland/Libraries/LibJS/Runtime/Temporal/PlainYearMonthPrototype.cpp @@ -28,25 +28,25 @@ void PlainYearMonthPrototype::initialize(GlobalObject& global_object) // 9.3.2 Temporal.PlainYearMonth.prototype[ @@toStringTag ], https://tc39.es/proposal-temporal/#sec-temporal.plainyearmonth.prototype-@@tostringtag define_direct_property(*vm.well_known_symbol_to_string_tag(), js_string(vm, "Temporal.PlainYearMonth"), Attribute::Configurable); - define_native_accessor(vm.names.calendar, calendar_getter, {}, Attribute::Configurable); - define_native_accessor(vm.names.year, year_getter, {}, Attribute::Configurable); - define_native_accessor(vm.names.month, month_getter, {}, Attribute::Configurable); - define_native_accessor(vm.names.monthCode, month_code_getter, {}, Attribute::Configurable); - define_native_accessor(vm.names.daysInYear, days_in_year_getter, {}, Attribute::Configurable); - define_native_accessor(vm.names.daysInMonth, days_in_month_getter, {}, Attribute::Configurable); - define_native_accessor(vm.names.monthsInYear, months_in_year_getter, {}, Attribute::Configurable); - define_native_accessor(vm.names.inLeapYear, in_leap_year_getter, {}, Attribute::Configurable); - define_native_accessor(vm.names.era, era_getter, {}, Attribute::Configurable); - define_native_accessor(vm.names.eraYear, era_year_getter, {}, Attribute::Configurable); + define_old_native_accessor(vm.names.calendar, calendar_getter, {}, Attribute::Configurable); + define_old_native_accessor(vm.names.year, year_getter, {}, Attribute::Configurable); + define_old_native_accessor(vm.names.month, month_getter, {}, Attribute::Configurable); + define_old_native_accessor(vm.names.monthCode, month_code_getter, {}, Attribute::Configurable); + define_old_native_accessor(vm.names.daysInYear, days_in_year_getter, {}, Attribute::Configurable); + define_old_native_accessor(vm.names.daysInMonth, days_in_month_getter, {}, Attribute::Configurable); + define_old_native_accessor(vm.names.monthsInYear, months_in_year_getter, {}, Attribute::Configurable); + define_old_native_accessor(vm.names.inLeapYear, in_leap_year_getter, {}, Attribute::Configurable); + define_old_native_accessor(vm.names.era, era_getter, {}, Attribute::Configurable); + define_old_native_accessor(vm.names.eraYear, era_year_getter, {}, Attribute::Configurable); u8 attr = Attribute::Writable | Attribute::Configurable; - define_native_function(vm.names.equals, equals, 1, attr); - define_native_function(vm.names.toString, to_string, 0, attr); - define_native_function(vm.names.toLocaleString, to_locale_string, 0, attr); - define_native_function(vm.names.toJSON, to_json, 0, attr); - define_native_function(vm.names.valueOf, value_of, 0, attr); - define_native_function(vm.names.toPlainDate, to_plain_date, 1, attr); - define_native_function(vm.names.getISOFields, get_iso_fields, 0, attr); + define_old_native_function(vm.names.equals, equals, 1, attr); + define_old_native_function(vm.names.toString, to_string, 0, attr); + define_old_native_function(vm.names.toLocaleString, to_locale_string, 0, attr); + define_old_native_function(vm.names.toJSON, to_json, 0, attr); + define_old_native_function(vm.names.valueOf, value_of, 0, attr); + define_old_native_function(vm.names.toPlainDate, to_plain_date, 1, attr); + define_old_native_function(vm.names.getISOFields, get_iso_fields, 0, attr); } // 9.3.3 get Temporal.PlainYearMonth.prototype.calendar, https://tc39.es/proposal-temporal/#sec-get-temporal.plainyearmonth.prototype.calendar diff --git a/Userland/Libraries/LibJS/Runtime/Temporal/TimeZoneConstructor.cpp b/Userland/Libraries/LibJS/Runtime/Temporal/TimeZoneConstructor.cpp index 09c04527d0..705a5d3a47 100644 --- a/Userland/Libraries/LibJS/Runtime/Temporal/TimeZoneConstructor.cpp +++ b/Userland/Libraries/LibJS/Runtime/Temporal/TimeZoneConstructor.cpp @@ -26,7 +26,7 @@ void TimeZoneConstructor::initialize(GlobalObject& global_object) define_direct_property(vm.names.prototype, global_object.temporal_time_zone_prototype(), 0); u8 attr = Attribute::Writable | Attribute::Configurable; - define_native_function(vm.names.from, from, 1, attr); + define_old_native_function(vm.names.from, from, 1, attr); define_direct_property(vm.names.length, Value(1), Attribute::Configurable); } diff --git a/Userland/Libraries/LibJS/Runtime/Temporal/TimeZonePrototype.cpp b/Userland/Libraries/LibJS/Runtime/Temporal/TimeZonePrototype.cpp index cc1d425285..36388ab8e9 100644 --- a/Userland/Libraries/LibJS/Runtime/Temporal/TimeZonePrototype.cpp +++ b/Userland/Libraries/LibJS/Runtime/Temporal/TimeZonePrototype.cpp @@ -27,12 +27,12 @@ void TimeZonePrototype::initialize(GlobalObject& global_object) auto& vm = this->vm(); u8 attr = Attribute::Writable | Attribute::Configurable; - define_native_accessor(vm.names.id, id_getter, {}, Attribute::Configurable); - define_native_function(vm.names.getOffsetNanosecondsFor, get_offset_nanoseconds_for, 1, attr); - define_native_function(vm.names.getOffsetStringFor, get_offset_string_for, 1, attr); - define_native_function(vm.names.getPlainDateTimeFor, get_plain_date_time_for, 1, attr); - define_native_function(vm.names.toString, to_string, 0, attr); - define_native_function(vm.names.toJSON, to_json, 0, attr); + define_old_native_accessor(vm.names.id, id_getter, {}, Attribute::Configurable); + define_old_native_function(vm.names.getOffsetNanosecondsFor, get_offset_nanoseconds_for, 1, attr); + define_old_native_function(vm.names.getOffsetStringFor, get_offset_string_for, 1, attr); + define_old_native_function(vm.names.getPlainDateTimeFor, get_plain_date_time_for, 1, attr); + define_old_native_function(vm.names.toString, to_string, 0, attr); + define_old_native_function(vm.names.toJSON, to_json, 0, attr); // 11.4.2 Temporal.TimeZone.prototype[ @@toStringTag ], https://tc39.es/proposal-temporal/#sec-temporal.timezone.prototype-@@tostringtag define_direct_property(*vm.well_known_symbol_to_string_tag(), js_string(vm, "Temporal.TimeZone"), Attribute::Configurable); diff --git a/Userland/Libraries/LibJS/Runtime/Temporal/ZonedDateTimePrototype.cpp b/Userland/Libraries/LibJS/Runtime/Temporal/ZonedDateTimePrototype.cpp index 9ff27cd88b..e6b8f3fd42 100644 --- a/Userland/Libraries/LibJS/Runtime/Temporal/ZonedDateTimePrototype.cpp +++ b/Userland/Libraries/LibJS/Runtime/Temporal/ZonedDateTimePrototype.cpp @@ -33,44 +33,44 @@ void ZonedDateTimePrototype::initialize(GlobalObject& global_object) // 6.3.2 Temporal.ZonedDateTime.prototype[ @@toStringTag ], https://tc39.es/proposal-temporal/#sec-temporal.zoneddatetime.prototype-@@tostringtag define_direct_property(*vm.well_known_symbol_to_string_tag(), js_string(vm, "Temporal.ZonedDateTime"), Attribute::Configurable); - define_native_accessor(vm.names.calendar, calendar_getter, {}, Attribute::Configurable); - define_native_accessor(vm.names.timeZone, time_zone_getter, {}, Attribute::Configurable); - define_native_accessor(vm.names.year, year_getter, {}, Attribute::Configurable); - define_native_accessor(vm.names.month, month_getter, {}, Attribute::Configurable); - define_native_accessor(vm.names.monthCode, month_code_getter, {}, Attribute::Configurable); - define_native_accessor(vm.names.day, day_getter, {}, Attribute::Configurable); - define_native_accessor(vm.names.hour, hour_getter, {}, Attribute::Configurable); - define_native_accessor(vm.names.minute, minute_getter, {}, Attribute::Configurable); - define_native_accessor(vm.names.second, second_getter, {}, Attribute::Configurable); - define_native_accessor(vm.names.millisecond, millisecond_getter, {}, Attribute::Configurable); - define_native_accessor(vm.names.microsecond, microsecond_getter, {}, Attribute::Configurable); - define_native_accessor(vm.names.nanosecond, nanosecond_getter, {}, Attribute::Configurable); - define_native_accessor(vm.names.epochSeconds, epoch_seconds_getter, {}, Attribute::Configurable); - define_native_accessor(vm.names.epochMilliseconds, epoch_milliseconds_getter, {}, Attribute::Configurable); - define_native_accessor(vm.names.epochMicroseconds, epoch_microseconds_getter, {}, Attribute::Configurable); - define_native_accessor(vm.names.epochNanoseconds, epoch_nanoseconds_getter, {}, Attribute::Configurable); - define_native_accessor(vm.names.dayOfWeek, day_of_week_getter, {}, Attribute::Configurable); - define_native_accessor(vm.names.dayOfYear, day_of_year_getter, {}, Attribute::Configurable); - define_native_accessor(vm.names.weekOfYear, week_of_year_getter, {}, Attribute::Configurable); - define_native_accessor(vm.names.daysInWeek, days_in_week_getter, {}, Attribute::Configurable); - define_native_accessor(vm.names.daysInMonth, days_in_month_getter, {}, Attribute::Configurable); - define_native_accessor(vm.names.daysInYear, days_in_year_getter, {}, Attribute::Configurable); - define_native_accessor(vm.names.monthsInYear, months_in_year_getter, {}, Attribute::Configurable); - define_native_accessor(vm.names.inLeapYear, in_leap_year_getter, {}, Attribute::Configurable); - define_native_accessor(vm.names.offsetNanoseconds, offset_nanoseconds_getter, {}, Attribute::Configurable); - define_native_accessor(vm.names.offset, offset_getter, {}, Attribute::Configurable); - define_native_accessor(vm.names.era, era_getter, {}, Attribute::Configurable); - define_native_accessor(vm.names.eraYear, era_year_getter, {}, Attribute::Configurable); + define_old_native_accessor(vm.names.calendar, calendar_getter, {}, Attribute::Configurable); + define_old_native_accessor(vm.names.timeZone, time_zone_getter, {}, Attribute::Configurable); + define_old_native_accessor(vm.names.year, year_getter, {}, Attribute::Configurable); + define_old_native_accessor(vm.names.month, month_getter, {}, Attribute::Configurable); + define_old_native_accessor(vm.names.monthCode, month_code_getter, {}, Attribute::Configurable); + define_old_native_accessor(vm.names.day, day_getter, {}, Attribute::Configurable); + define_old_native_accessor(vm.names.hour, hour_getter, {}, Attribute::Configurable); + define_old_native_accessor(vm.names.minute, minute_getter, {}, Attribute::Configurable); + define_old_native_accessor(vm.names.second, second_getter, {}, Attribute::Configurable); + define_old_native_accessor(vm.names.millisecond, millisecond_getter, {}, Attribute::Configurable); + define_old_native_accessor(vm.names.microsecond, microsecond_getter, {}, Attribute::Configurable); + define_old_native_accessor(vm.names.nanosecond, nanosecond_getter, {}, Attribute::Configurable); + define_old_native_accessor(vm.names.epochSeconds, epoch_seconds_getter, {}, Attribute::Configurable); + define_old_native_accessor(vm.names.epochMilliseconds, epoch_milliseconds_getter, {}, Attribute::Configurable); + define_old_native_accessor(vm.names.epochMicroseconds, epoch_microseconds_getter, {}, Attribute::Configurable); + define_old_native_accessor(vm.names.epochNanoseconds, epoch_nanoseconds_getter, {}, Attribute::Configurable); + define_old_native_accessor(vm.names.dayOfWeek, day_of_week_getter, {}, Attribute::Configurable); + define_old_native_accessor(vm.names.dayOfYear, day_of_year_getter, {}, Attribute::Configurable); + define_old_native_accessor(vm.names.weekOfYear, week_of_year_getter, {}, Attribute::Configurable); + define_old_native_accessor(vm.names.daysInWeek, days_in_week_getter, {}, Attribute::Configurable); + define_old_native_accessor(vm.names.daysInMonth, days_in_month_getter, {}, Attribute::Configurable); + define_old_native_accessor(vm.names.daysInYear, days_in_year_getter, {}, Attribute::Configurable); + define_old_native_accessor(vm.names.monthsInYear, months_in_year_getter, {}, Attribute::Configurable); + define_old_native_accessor(vm.names.inLeapYear, in_leap_year_getter, {}, Attribute::Configurable); + define_old_native_accessor(vm.names.offsetNanoseconds, offset_nanoseconds_getter, {}, Attribute::Configurable); + define_old_native_accessor(vm.names.offset, offset_getter, {}, Attribute::Configurable); + define_old_native_accessor(vm.names.era, era_getter, {}, Attribute::Configurable); + define_old_native_accessor(vm.names.eraYear, era_year_getter, {}, Attribute::Configurable); u8 attr = Attribute::Writable | Attribute::Configurable; - define_native_function(vm.names.valueOf, value_of, 0, attr); - define_native_function(vm.names.toInstant, to_instant, 0, attr); - define_native_function(vm.names.toPlainDate, to_plain_date, 0, attr); - define_native_function(vm.names.toPlainTime, to_plain_time, 0, attr); - define_native_function(vm.names.toPlainDateTime, to_plain_date_time, 0, attr); - define_native_function(vm.names.toPlainYearMonth, to_plain_year_month, 0, attr); - define_native_function(vm.names.toPlainMonthDay, to_plain_month_day, 0, attr); - define_native_function(vm.names.getISOFields, get_iso_fields, 0, attr); + define_old_native_function(vm.names.valueOf, value_of, 0, attr); + define_old_native_function(vm.names.toInstant, to_instant, 0, attr); + define_old_native_function(vm.names.toPlainDate, to_plain_date, 0, attr); + define_old_native_function(vm.names.toPlainTime, to_plain_time, 0, attr); + define_old_native_function(vm.names.toPlainDateTime, to_plain_date_time, 0, attr); + define_old_native_function(vm.names.toPlainYearMonth, to_plain_year_month, 0, attr); + define_old_native_function(vm.names.toPlainMonthDay, to_plain_month_day, 0, attr); + define_old_native_function(vm.names.getISOFields, get_iso_fields, 0, attr); } // 6.3.3 get Temporal.ZonedDateTime.prototype.calendar, https://tc39.es/proposal-temporal/#sec-get-temporal.zoneddatetime.prototype.calendar diff --git a/Userland/Libraries/LibJS/Runtime/TypedArrayConstructor.cpp b/Userland/Libraries/LibJS/Runtime/TypedArrayConstructor.cpp index c088ebf51d..e98fa19824 100644 --- a/Userland/Libraries/LibJS/Runtime/TypedArrayConstructor.cpp +++ b/Userland/Libraries/LibJS/Runtime/TypedArrayConstructor.cpp @@ -30,10 +30,10 @@ void TypedArrayConstructor::initialize(GlobalObject& global_object) define_direct_property(vm.names.prototype, global_object.typed_array_prototype(), 0); u8 attr = Attribute::Writable | Attribute::Configurable; - define_native_function(vm.names.from, from, 1, attr); - define_native_function(vm.names.of, of, 0, attr); + define_old_native_function(vm.names.from, from, 1, attr); + define_old_native_function(vm.names.of, of, 0, attr); - define_native_accessor(*vm.well_known_symbol_species(), symbol_species_getter, {}, Attribute::Configurable); + define_old_native_accessor(*vm.well_known_symbol_species(), symbol_species_getter, {}, Attribute::Configurable); define_direct_property(vm.names.length, Value(0), Attribute::Configurable); } diff --git a/Userland/Libraries/LibJS/Runtime/TypedArrayPrototype.cpp b/Userland/Libraries/LibJS/Runtime/TypedArrayPrototype.cpp index 428976af23..511b79a269 100644 --- a/Userland/Libraries/LibJS/Runtime/TypedArrayPrototype.cpp +++ b/Userland/Libraries/LibJS/Runtime/TypedArrayPrototype.cpp @@ -25,39 +25,39 @@ void TypedArrayPrototype::initialize(GlobalObject& object) Object::initialize(object); u8 attr = Attribute::Writable | Attribute::Configurable; - define_native_accessor(vm.names.length, length_getter, nullptr, Attribute::Configurable); - define_native_accessor(vm.names.buffer, buffer_getter, nullptr, Attribute::Configurable); - define_native_accessor(vm.names.byteLength, byte_length_getter, nullptr, Attribute::Configurable); - define_native_accessor(vm.names.byteOffset, byte_offset_getter, nullptr, Attribute::Configurable); - define_native_function(vm.names.at, at, 1, attr); - define_native_function(vm.names.every, every, 1, attr); - define_native_function(vm.names.fill, fill, 1, attr); - define_native_function(vm.names.find, find, 1, attr); - define_native_function(vm.names.findIndex, find_index, 1, attr); - define_native_function(vm.names.findLast, find_last, 1, attr); - define_native_function(vm.names.findLastIndex, find_last_index, 1, attr); - define_native_function(vm.names.forEach, for_each, 1, attr); - define_native_function(vm.names.includes, includes, 1, attr); - define_native_function(vm.names.indexOf, index_of, 1, attr); - define_native_function(vm.names.lastIndexOf, last_index_of, 1, attr); - define_native_function(vm.names.reduce, reduce, 1, attr); - define_native_function(vm.names.reduceRight, reduce_right, 1, attr); - define_native_function(vm.names.some, some, 1, attr); - define_native_function(vm.names.join, join, 1, attr); - define_native_function(vm.names.keys, keys, 0, attr); - define_native_function(vm.names.values, values, 0, attr); - define_native_function(vm.names.entries, entries, 0, attr); - define_native_function(vm.names.set, set, 1, attr); - define_native_function(vm.names.slice, slice, 2, attr); - define_native_function(vm.names.sort, sort, 1, attr); - define_native_function(vm.names.subarray, subarray, 2, attr); - define_native_function(vm.names.reverse, reverse, 0, attr); - define_native_function(vm.names.copyWithin, copy_within, 2, attr); - define_native_function(vm.names.filter, filter, 1, attr); - define_native_function(vm.names.map, map, 1, attr); - define_native_function(vm.names.toLocaleString, to_locale_string, 0, attr); - - define_native_accessor(*vm.well_known_symbol_to_string_tag(), to_string_tag_getter, nullptr, Attribute::Configurable); + define_old_native_accessor(vm.names.length, length_getter, nullptr, Attribute::Configurable); + define_old_native_accessor(vm.names.buffer, buffer_getter, nullptr, Attribute::Configurable); + define_old_native_accessor(vm.names.byteLength, byte_length_getter, nullptr, Attribute::Configurable); + define_old_native_accessor(vm.names.byteOffset, byte_offset_getter, nullptr, Attribute::Configurable); + define_old_native_function(vm.names.at, at, 1, attr); + define_old_native_function(vm.names.every, every, 1, attr); + define_old_native_function(vm.names.fill, fill, 1, attr); + define_old_native_function(vm.names.find, find, 1, attr); + define_old_native_function(vm.names.findIndex, find_index, 1, attr); + define_old_native_function(vm.names.findLast, find_last, 1, attr); + define_old_native_function(vm.names.findLastIndex, find_last_index, 1, attr); + define_old_native_function(vm.names.forEach, for_each, 1, attr); + define_old_native_function(vm.names.includes, includes, 1, attr); + define_old_native_function(vm.names.indexOf, index_of, 1, attr); + define_old_native_function(vm.names.lastIndexOf, last_index_of, 1, attr); + define_old_native_function(vm.names.reduce, reduce, 1, attr); + define_old_native_function(vm.names.reduceRight, reduce_right, 1, attr); + define_old_native_function(vm.names.some, some, 1, attr); + define_old_native_function(vm.names.join, join, 1, attr); + define_old_native_function(vm.names.keys, keys, 0, attr); + define_old_native_function(vm.names.values, values, 0, attr); + define_old_native_function(vm.names.entries, entries, 0, attr); + define_old_native_function(vm.names.set, set, 1, attr); + define_old_native_function(vm.names.slice, slice, 2, attr); + define_old_native_function(vm.names.sort, sort, 1, attr); + define_old_native_function(vm.names.subarray, subarray, 2, attr); + define_old_native_function(vm.names.reverse, reverse, 0, attr); + define_old_native_function(vm.names.copyWithin, copy_within, 2, attr); + define_old_native_function(vm.names.filter, filter, 1, attr); + define_old_native_function(vm.names.map, map, 1, attr); + define_old_native_function(vm.names.toLocaleString, to_locale_string, 0, attr); + + define_old_native_accessor(*vm.well_known_symbol_to_string_tag(), to_string_tag_getter, nullptr, Attribute::Configurable); // 23.2.3.29 %TypedArray%.prototype.toString ( ), https://tc39.es/ecma262/#sec-%typedarray%.prototype.tostring define_direct_property(vm.names.toString, global_object().array_prototype()->get_without_side_effects(vm.names.toString), attr); diff --git a/Userland/Libraries/LibJS/Runtime/WeakMapPrototype.cpp b/Userland/Libraries/LibJS/Runtime/WeakMapPrototype.cpp index 4c1b06b8e6..69be97880a 100644 --- a/Userland/Libraries/LibJS/Runtime/WeakMapPrototype.cpp +++ b/Userland/Libraries/LibJS/Runtime/WeakMapPrototype.cpp @@ -21,10 +21,10 @@ void WeakMapPrototype::initialize(GlobalObject& global_object) Object::initialize(global_object); u8 attr = Attribute::Writable | Attribute::Configurable; - define_native_function(vm.names.delete_, delete_, 1, attr); - define_native_function(vm.names.get, get, 1, attr); - define_native_function(vm.names.has, has, 1, attr); - define_native_function(vm.names.set, set, 2, attr); + define_old_native_function(vm.names.delete_, delete_, 1, attr); + define_old_native_function(vm.names.get, get, 1, attr); + define_old_native_function(vm.names.has, has, 1, attr); + define_old_native_function(vm.names.set, set, 2, attr); // 24.3.3.6 WeakMap.prototype [ @@toStringTag ], https://tc39.es/ecma262/#sec-weakmap.prototype-@@tostringtag define_direct_property(*vm.well_known_symbol_to_string_tag(), js_string(vm, vm.names.WeakMap.as_string()), Attribute::Configurable); diff --git a/Userland/Libraries/LibJS/Runtime/WeakRefPrototype.cpp b/Userland/Libraries/LibJS/Runtime/WeakRefPrototype.cpp index 8d392bd169..7ca695632f 100644 --- a/Userland/Libraries/LibJS/Runtime/WeakRefPrototype.cpp +++ b/Userland/Libraries/LibJS/Runtime/WeakRefPrototype.cpp @@ -19,7 +19,7 @@ void WeakRefPrototype::initialize(GlobalObject& global_object) auto& vm = this->vm(); Object::initialize(global_object); - define_native_function(vm.names.deref, deref, 0, Attribute::Writable | Attribute::Configurable); + define_old_native_function(vm.names.deref, deref, 0, Attribute::Writable | Attribute::Configurable); define_direct_property(*vm.well_known_symbol_to_string_tag(), js_string(vm, vm.names.WeakRef.as_string()), Attribute::Configurable); } diff --git a/Userland/Libraries/LibJS/Runtime/WeakSetPrototype.cpp b/Userland/Libraries/LibJS/Runtime/WeakSetPrototype.cpp index 566d71c29d..1348eacf13 100644 --- a/Userland/Libraries/LibJS/Runtime/WeakSetPrototype.cpp +++ b/Userland/Libraries/LibJS/Runtime/WeakSetPrototype.cpp @@ -21,9 +21,9 @@ void WeakSetPrototype::initialize(GlobalObject& global_object) Object::initialize(global_object); u8 attr = Attribute::Writable | Attribute::Configurable; - define_native_function(vm.names.add, add, 1, attr); - define_native_function(vm.names.delete_, delete_, 1, attr); - define_native_function(vm.names.has, has, 1, attr); + define_old_native_function(vm.names.add, add, 1, attr); + define_old_native_function(vm.names.delete_, delete_, 1, attr); + define_old_native_function(vm.names.has, has, 1, attr); // 24.4.3.5 WeakSet.prototype [ @@toStringTag ], https://tc39.es/ecma262/#sec-weakset.prototype-@@tostringtag define_direct_property(*vm.well_known_symbol_to_string_tag(), js_string(global_object.heap(), vm.names.WeakSet.as_string()), Attribute::Configurable); |