LibJS: Rename define_native_function => define_old_native_function

This method will eventually be removed once all native functions are
converted to ThrowCompletionOr
This commit is contained in:
Idan Horowitz 2021-10-20 01:40:40 +03:00 committed by Linus Groh
parent ca27e5eff5
commit 40eb3a39d4
Notes: sideshowbarker 2024-07-18 02:08:47 +09:00
95 changed files with 755 additions and 755 deletions

View file

@ -171,7 +171,7 @@ void TestRunnerGlobalObject::initialize_global_object()
{
Base::initialize_global_object();
define_direct_property("global", this, JS::Attribute::Enumerable);
define_native_function("fuzzilli", fuzzilli, 2, JS::default_attributes);
define_old_native_function("fuzzilli", fuzzilli, 2, JS::default_attributes);
}
int main(int, char**)

View file

@ -2732,7 +2732,7 @@ define_direct_property("@constant.name@", JS::Value((i32)@constant.value@), JS::
function_generator.set("function.length", String::number(function.length()));
function_generator.append(R"~~~(
define_native_function("@function.name@", @function.name:snakecase@, @function.length@, default_attributes);
define_old_native_function("@function.name@", @function.name:snakecase@, @function.length@, default_attributes);
)~~~");
}
@ -3051,7 +3051,7 @@ void @prototype_class@::initialize(JS::GlobalObject& global_object)
}
attribute_generator.append(R"~~~(
define_native_accessor("@attribute.name@", @attribute.getter_callback@, @attribute.setter_callback@, default_attributes);
define_old_native_accessor("@attribute.name@", @attribute.getter_callback@, @attribute.setter_callback@, default_attributes);
)~~~");
}
@ -3082,7 +3082,7 @@ void @prototype_class@::initialize(JS::GlobalObject& global_object)
}
function_generator.append(R"~~~(
define_native_function("@function.name@", @function.name:snakecase@, @function.length@, default_attributes);
define_old_native_function("@function.name@", @function.name:snakecase@, @function.length@, default_attributes);
)~~~");
}
@ -3091,7 +3091,7 @@ void @prototype_class@::initialize(JS::GlobalObject& global_object)
auto stringifier_generator = generator.fork();
stringifier_generator.append(R"~~~(
define_native_function("toString", to_string, 0, default_attributes);
define_old_native_function("toString", to_string, 0, default_attributes);
)~~~");
}
@ -3118,10 +3118,10 @@ void @prototype_class@::initialize(JS::GlobalObject& global_object)
auto iterator_generator = generator.fork();
iterator_generator.append(R"~~~(
define_native_function(vm.names.entries, entries, 0, default_attributes);
define_native_function(vm.names.forEach, for_each, 1, default_attributes);
define_native_function(vm.names.keys, keys, 0, default_attributes);
define_native_function(vm.names.values, values, 0, default_attributes);
define_old_native_function(vm.names.entries, entries, 0, default_attributes);
define_old_native_function(vm.names.forEach, for_each, 1, default_attributes);
define_old_native_function(vm.names.keys, keys, 0, default_attributes);
define_old_native_function(vm.names.values, values, 0, default_attributes);
define_direct_property(*vm.well_known_symbol_iterator(), get_without_side_effects(vm.names.entries), JS::Attribute::Configurable | JS::Attribute::Writable);
)~~~");
@ -3638,7 +3638,7 @@ void @prototype_class@::initialize(JS::GlobalObject& global_object)
auto& vm = this->vm();
Object::initialize(global_object);
define_native_function(vm.names.next, next, 0, JS::Attribute::Configurable | JS::Attribute::Writable);
define_old_native_function(vm.names.next, next, 0, JS::Attribute::Configurable | JS::Attribute::Writable);
define_direct_property(*vm.well_known_symbol_to_string_tag(), js_string(vm, "Iterator"), JS::Attribute::Configurable);
}

View file

@ -155,8 +155,8 @@ TESTJS_GLOBAL_FUNCTION(compare_typed_arrays, compareTypedArrays)
void WebAssemblyModule::initialize(JS::GlobalObject& global_object)
{
Base::initialize(global_object);
define_native_function("getExport", get_export, 1, JS::default_attributes);
define_native_function("invoke", wasm_invoke, 1, JS::default_attributes);
define_old_native_function("getExport", get_export, 1, JS::default_attributes);
define_old_native_function("invoke", wasm_invoke, 1, JS::default_attributes);
}
JS_DEFINE_OLD_NATIVE_FUNCTION(WebAssemblyModule::get_export)

View file

@ -151,12 +151,12 @@ void SheetGlobalObject::initialize_global_object()
{
Base::initialize_global_object();
u8 attr = JS::Attribute::Configurable | JS::Attribute::Writable | JS::Attribute::Enumerable;
define_native_function("get_real_cell_contents", get_real_cell_contents, 1, attr);
define_native_function("set_real_cell_contents", set_real_cell_contents, 2, attr);
define_native_function("parse_cell_name", parse_cell_name, 1, attr);
define_native_function("current_cell_position", current_cell_position, 0, attr);
define_native_function("column_arithmetic", column_arithmetic, 2, attr);
define_native_function("column_index", column_index, 1, attr);
define_old_native_function("get_real_cell_contents", get_real_cell_contents, 1, attr);
define_old_native_function("set_real_cell_contents", set_real_cell_contents, 2, attr);
define_old_native_function("parse_cell_name", parse_cell_name, 1, attr);
define_old_native_function("current_cell_position", current_cell_position, 0, attr);
define_old_native_function("column_arithmetic", column_arithmetic, 2, attr);
define_old_native_function("column_index", column_index, 1, attr);
}
void SheetGlobalObject::visit_edges(Visitor& visitor)
@ -387,7 +387,7 @@ WorkbookObject::~WorkbookObject()
void WorkbookObject::initialize(JS::GlobalObject& global_object)
{
Object::initialize(global_object);
define_native_function("sheet", sheet, 1, JS::default_attributes);
define_old_native_function("sheet", sheet, 1, JS::default_attributes);
}
void WorkbookObject::visit_edges(Visitor& visitor)

View file

@ -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));

View file

@ -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);
}

View file

@ -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);

View file

@ -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);
}

View file

@ -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);

View file

@ -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);
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_native_function so that
// 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

View file

@ -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);

View file

@ -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);
}

View file

@ -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);

View file

@ -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()

View file

@ -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()

View file

@ -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_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_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_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);

View file

@ -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);
}

View file

@ -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

View file

@ -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

View file

@ -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);

View file

@ -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);
}

View file

@ -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);

View file

@ -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);

View file

@ -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);
}

View file

@ -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

View file

@ -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

View file

@ -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);
}

View file

@ -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

View file

@ -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

View file

@ -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);
}

View file

@ -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

View file

@ -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()

View file

@ -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);

View file

@ -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);
}

View file

@ -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);
}

View file

@ -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_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_native_accessor(vm.names.size, size_getter, {}, Attribute::Configurable);
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);

View file

@ -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);

View file

@ -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);

View file

@ -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()

View file

@ -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;

View file

@ -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; }

View file

@ -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);
}

View file

@ -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()

View file

@ -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_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_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);
}

View file

@ -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);

View file

@ -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);
}

View file

@ -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);

View file

@ -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);
}

View file

@ -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
}

View file

@ -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);

View file

@ -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);
}

View file

@ -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);

View file

@ -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);

View file

@ -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);

View file

@ -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);
}

View file

@ -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);

View file

@ -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()

View file

@ -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);

View file

@ -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);

View file

@ -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);
}

View file

@ -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

View file

@ -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);
}

View file

@ -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

View file

@ -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);
}

View file

@ -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

View file

@ -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

View file

@ -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);
}

View file

@ -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

View file

@ -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);
}

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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);
}

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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);
}

View file

@ -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);

View file

@ -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

View file

@ -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);
}

View file

@ -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_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_native_accessor(*vm.well_known_symbol_to_string_tag(), to_string_tag_getter, nullptr, Attribute::Configurable);
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);

View file

@ -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);

View file

@ -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);
}

View file

@ -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);

View file

@ -191,7 +191,7 @@ inline void TestRunnerGlobalObject::initialize_global_object()
Base::initialize_global_object();
define_direct_property("global", this, JS::Attribute::Enumerable);
for (auto& entry : s_exposed_global_functions) {
define_native_function(
define_old_native_function(
entry.key, [fn = entry.value.function](auto& vm, auto& global_object) {
return fn(vm, global_object);
},

View file

@ -26,8 +26,8 @@ void CSSNamespace::initialize(JS::GlobalObject& global_object)
{
Object::initialize(global_object);
u8 attr = JS::Attribute::Enumerable;
define_native_function("escape", escape, 1, attr);
define_native_function("supports", supports, 2, attr);
define_old_native_function("escape", escape, 1, attr);
define_old_native_function("supports", supports, 2, attr);
}
// https://www.w3.org/TR/cssom-1/#dom-css-escape

View file

@ -25,19 +25,19 @@ void LocationObject::initialize(JS::GlobalObject& global_object)
Object::initialize(global_object);
u8 attr = JS::Attribute::Writable | JS::Attribute::Enumerable;
define_native_accessor("href", href_getter, href_setter, attr);
define_native_accessor("host", host_getter, {}, attr);
define_native_accessor("hostname", hostname_getter, {}, attr);
define_native_accessor("pathname", pathname_getter, {}, attr);
define_native_accessor("hash", hash_getter, {}, attr);
define_native_accessor("search", search_getter, {}, attr);
define_native_accessor("protocol", protocol_getter, {}, attr);
define_native_accessor("port", port_getter, {}, attr);
define_old_native_accessor("href", href_getter, href_setter, attr);
define_old_native_accessor("host", host_getter, {}, attr);
define_old_native_accessor("hostname", hostname_getter, {}, attr);
define_old_native_accessor("pathname", pathname_getter, {}, attr);
define_old_native_accessor("hash", hash_getter, {}, attr);
define_old_native_accessor("search", search_getter, {}, attr);
define_old_native_accessor("protocol", protocol_getter, {}, attr);
define_old_native_accessor("port", port_getter, {}, attr);
define_native_function("reload", reload, 0, JS::Attribute::Enumerable);
define_native_function("replace", replace, 1, JS::Attribute::Enumerable);
define_old_native_function("reload", reload, 0, JS::Attribute::Enumerable);
define_old_native_function("replace", replace, 1, JS::Attribute::Enumerable);
define_native_function(vm.names.toString, href_getter, 0, JS::Attribute::Enumerable);
define_old_native_function(vm.names.toString, href_getter, 0, JS::Attribute::Enumerable);
}
LocationObject::~LocationObject()

View file

@ -33,8 +33,8 @@ void NavigatorObject::initialize(JS::GlobalObject& global_object)
define_direct_property("platform", js_string(heap, "SerenityOS"), attr);
define_direct_property("product", js_string(heap, "Gecko"), attr);
define_native_accessor("userAgent", user_agent_getter, {}, JS::Attribute::Configurable | JS::Attribute::Enumerable);
define_native_accessor("cookieEnabled", cookie_enabled_getter, {}, JS::Attribute::Configurable | JS::Attribute::Enumerable);
define_old_native_accessor("userAgent", user_agent_getter, {}, JS::Attribute::Configurable | JS::Attribute::Enumerable);
define_old_native_accessor("cookieEnabled", cookie_enabled_getter, {}, JS::Attribute::Configurable | JS::Attribute::Enumerable);
// FIXME: Reflect actual connectivity status.
define_direct_property("onLine", JS::Value(true), attr);

View file

@ -63,54 +63,54 @@ void WindowObject::initialize_global_object()
define_direct_property("window", this, JS::Attribute::Enumerable);
define_direct_property("frames", this, JS::Attribute::Enumerable);
define_direct_property("self", this, JS::Attribute::Enumerable);
define_native_accessor("top", top_getter, nullptr, JS::Attribute::Enumerable);
define_native_accessor("parent", parent_getter, {}, JS::Attribute::Enumerable);
define_native_accessor("document", document_getter, {}, JS::Attribute::Enumerable);
define_native_accessor("history", history_getter, {}, JS::Attribute::Enumerable);
define_native_accessor("performance", performance_getter, {}, JS::Attribute::Enumerable);
define_native_accessor("crypto", crypto_getter, {}, JS::Attribute::Enumerable);
define_native_accessor("screen", screen_getter, {}, JS::Attribute::Enumerable);
define_native_accessor("innerWidth", inner_width_getter, {}, JS::Attribute::Enumerable);
define_native_accessor("innerHeight", inner_height_getter, {}, JS::Attribute::Enumerable);
define_native_accessor("devicePixelRatio", device_pixel_ratio_getter, {}, JS::Attribute::Enumerable | JS::Attribute::Configurable);
define_old_native_accessor("top", top_getter, nullptr, JS::Attribute::Enumerable);
define_old_native_accessor("parent", parent_getter, {}, JS::Attribute::Enumerable);
define_old_native_accessor("document", document_getter, {}, JS::Attribute::Enumerable);
define_old_native_accessor("history", history_getter, {}, JS::Attribute::Enumerable);
define_old_native_accessor("performance", performance_getter, {}, JS::Attribute::Enumerable);
define_old_native_accessor("crypto", crypto_getter, {}, JS::Attribute::Enumerable);
define_old_native_accessor("screen", screen_getter, {}, JS::Attribute::Enumerable);
define_old_native_accessor("innerWidth", inner_width_getter, {}, JS::Attribute::Enumerable);
define_old_native_accessor("innerHeight", inner_height_getter, {}, JS::Attribute::Enumerable);
define_old_native_accessor("devicePixelRatio", device_pixel_ratio_getter, {}, JS::Attribute::Enumerable | JS::Attribute::Configurable);
u8 attr = JS::Attribute::Writable | JS::Attribute::Enumerable | JS::Attribute::Configurable;
define_native_function("alert", alert, 0, attr);
define_native_function("confirm", confirm, 0, attr);
define_native_function("prompt", prompt, 0, attr);
define_native_function("setInterval", set_interval, 1, attr);
define_native_function("setTimeout", set_timeout, 1, attr);
define_native_function("clearInterval", clear_interval, 1, attr);
define_native_function("clearTimeout", clear_timeout, 1, attr);
define_native_function("requestAnimationFrame", request_animation_frame, 1, attr);
define_native_function("cancelAnimationFrame", cancel_animation_frame, 1, attr);
define_native_function("atob", atob, 1, attr);
define_native_function("btoa", btoa, 1, attr);
define_old_native_function("alert", alert, 0, attr);
define_old_native_function("confirm", confirm, 0, attr);
define_old_native_function("prompt", prompt, 0, attr);
define_old_native_function("setInterval", set_interval, 1, attr);
define_old_native_function("setTimeout", set_timeout, 1, attr);
define_old_native_function("clearInterval", clear_interval, 1, attr);
define_old_native_function("clearTimeout", clear_timeout, 1, attr);
define_old_native_function("requestAnimationFrame", request_animation_frame, 1, attr);
define_old_native_function("cancelAnimationFrame", cancel_animation_frame, 1, attr);
define_old_native_function("atob", atob, 1, attr);
define_old_native_function("btoa", btoa, 1, attr);
define_native_function("queueMicrotask", queue_microtask, 1, attr);
define_old_native_function("queueMicrotask", queue_microtask, 1, attr);
define_native_function("getComputedStyle", get_computed_style, 1, attr);
define_native_function("matchMedia", match_media, 1, attr);
define_native_function("getSelection", get_selection, 0, attr);
define_old_native_function("getComputedStyle", get_computed_style, 1, attr);
define_old_native_function("matchMedia", match_media, 1, attr);
define_old_native_function("getSelection", get_selection, 0, attr);
// FIXME: These properties should be [Replaceable] according to the spec, but [Writable+Configurable] is the closest we have.
define_native_accessor("scrollX", scroll_x_getter, {}, attr);
define_native_accessor("pageXOffset", scroll_x_getter, {}, attr);
define_native_accessor("scrollY", scroll_y_getter, {}, attr);
define_native_accessor("pageYOffset", scroll_y_getter, {}, attr);
define_old_native_accessor("scrollX", scroll_x_getter, {}, attr);
define_old_native_accessor("pageXOffset", scroll_x_getter, {}, attr);
define_old_native_accessor("scrollY", scroll_y_getter, {}, attr);
define_old_native_accessor("pageYOffset", scroll_y_getter, {}, attr);
define_native_function("scroll", scroll, 2, attr);
define_native_function("scrollTo", scroll, 2, attr);
define_native_function("scrollBy", scroll_by, 2, attr);
define_old_native_function("scroll", scroll, 2, attr);
define_old_native_function("scrollTo", scroll, 2, attr);
define_old_native_function("scrollBy", scroll_by, 2, attr);
define_native_accessor("screenX", screen_x_getter, {}, attr);
define_native_accessor("screenY", screen_y_getter, {}, attr);
define_native_accessor("screenLeft", screen_left_getter, {}, attr);
define_native_accessor("screenTop", screen_top_getter, {}, attr);
define_old_native_accessor("screenX", screen_x_getter, {}, attr);
define_old_native_accessor("screenY", screen_y_getter, {}, attr);
define_old_native_accessor("screenLeft", screen_left_getter, {}, attr);
define_old_native_accessor("screenTop", screen_top_getter, {}, attr);
define_direct_property("CSS", heap().allocate<CSSNamespace>(*this, *this), 0);
// Legacy
define_native_accessor("event", event_getter, event_setter, JS::Attribute::Enumerable);
define_old_native_accessor("event", event_getter, event_setter, JS::Attribute::Enumerable);
m_location_object = heap().allocate<LocationObject>(*this, *this);
@ -124,7 +124,7 @@ void WindowObject::initialize_global_object()
// HTML::GlobalEventHandlers
#define __ENUMERATE(attribute, event_name) \
define_native_accessor(#attribute, attribute##_getter, attribute##_setter, attr);
define_old_native_accessor(#attribute, attribute##_getter, attribute##_setter, attr);
ENUMERATE_GLOBAL_EVENT_HANDLERS(__ENUMERATE);
#undef __ENUMERATE

View file

@ -13,7 +13,7 @@ namespace Web::Bindings {
void WebAssemblyInstancePrototype::initialize(JS::GlobalObject& global_object)
{
Object::initialize(global_object);
define_native_accessor("exports", exports_getter, {}, JS::Attribute::Enumerable | JS::Attribute::Configurable);
define_old_native_accessor("exports", exports_getter, {}, JS::Attribute::Enumerable | JS::Attribute::Configurable);
}
JS_DEFINE_OLD_NATIVE_FUNCTION(WebAssemblyInstancePrototype::exports_getter)

View file

@ -13,8 +13,8 @@ namespace Web::Bindings {
void WebAssemblyMemoryPrototype::initialize(JS::GlobalObject& global_object)
{
Object::initialize(global_object);
define_native_accessor("buffer", buffer_getter, {}, JS::Attribute::Enumerable | JS::Attribute::Configurable);
define_native_function("grow", grow, 1, JS::Attribute::Writable | JS::Attribute::Enumerable | JS::Attribute::Configurable);
define_old_native_accessor("buffer", buffer_getter, {}, JS::Attribute::Enumerable | JS::Attribute::Configurable);
define_old_native_function("grow", grow, 1, JS::Attribute::Writable | JS::Attribute::Enumerable | JS::Attribute::Configurable);
}
JS_DEFINE_OLD_NATIVE_FUNCTION(WebAssemblyMemoryPrototype::grow)

View file

@ -35,9 +35,9 @@ void WebAssemblyObject::initialize(JS::GlobalObject& global_object)
Object::initialize(global_object);
u8 attr = JS::Attribute::Configurable | JS::Attribute::Writable | JS::Attribute::Enumerable;
define_native_function("validate", validate, 1, attr);
define_native_function("compile", compile, 1, attr);
define_native_function("instantiate", instantiate, 1, attr);
define_old_native_function("validate", validate, 1, attr);
define_old_native_function("compile", compile, 1, attr);
define_old_native_function("instantiate", instantiate, 1, attr);
auto& vm = global_object.vm();

View file

@ -13,10 +13,10 @@ namespace Web::Bindings {
void WebAssemblyTablePrototype::initialize(JS::GlobalObject& global_object)
{
Object::initialize(global_object);
define_native_accessor("length", length_getter, {}, JS::Attribute::Enumerable | JS::Attribute::Configurable);
define_native_function("grow", grow, 1, JS::Attribute::Writable | JS::Attribute::Enumerable | JS::Attribute::Configurable);
define_native_function("get", get, 1, JS::Attribute::Writable | JS::Attribute::Enumerable | JS::Attribute::Configurable);
define_native_function("set", set, 1, JS::Attribute::Writable | JS::Attribute::Enumerable | JS::Attribute::Configurable);
define_old_native_accessor("length", length_getter, {}, JS::Attribute::Enumerable | JS::Attribute::Configurable);
define_old_native_function("grow", grow, 1, JS::Attribute::Writable | JS::Attribute::Enumerable | JS::Attribute::Configurable);
define_old_native_function("get", get, 1, JS::Attribute::Writable | JS::Attribute::Enumerable | JS::Attribute::Configurable);
define_old_native_function("set", set, 1, JS::Attribute::Writable | JS::Attribute::Enumerable | JS::Attribute::Configurable);
}
JS_DEFINE_OLD_NATIVE_FUNCTION(WebAssemblyTablePrototype::grow)

View file

@ -28,7 +28,7 @@ void ConsoleGlobalObject::initialize_global_object()
Base::initialize_global_object();
// $0 magic variable
define_native_accessor("$0", inspected_node_getter, nullptr, 0);
define_old_native_accessor("$0", inspected_node_getter, nullptr, 0);
}
void ConsoleGlobalObject::visit_edges(Visitor& visitor)

View file

@ -941,11 +941,11 @@ void ReplObject::initialize_global_object()
Base::initialize_global_object();
define_direct_property("global", this, JS::Attribute::Enumerable);
u8 attr = JS::Attribute::Configurable | JS::Attribute::Writable | JS::Attribute::Enumerable;
define_native_function("exit", exit_interpreter, 0, attr);
define_native_function("help", repl_help, 0, attr);
define_native_function("load", load_file, 1, attr);
define_native_function("save", save_to_file, 1, attr);
define_native_function("loadJSON", load_json, 1, attr);
define_old_native_function("exit", exit_interpreter, 0, attr);
define_old_native_function("help", repl_help, 0, attr);
define_old_native_function("load", load_file, 1, attr);
define_old_native_function("save", save_to_file, 1, attr);
define_old_native_function("loadJSON", load_json, 1, attr);
}
JS_DEFINE_OLD_NATIVE_FUNCTION(ReplObject::save_to_file)
@ -992,8 +992,8 @@ void ScriptObject::initialize_global_object()
Base::initialize_global_object();
define_direct_property("global", this, JS::Attribute::Enumerable);
u8 attr = JS::Attribute::Configurable | JS::Attribute::Writable | JS::Attribute::Enumerable;
define_native_function("load", load_file, 1, attr);
define_native_function("loadJSON", load_json, 1, attr);
define_old_native_function("load", load_file, 1, attr);
define_old_native_function("loadJSON", load_json, 1, attr);
}
JS_DEFINE_OLD_NATIVE_FUNCTION(ScriptObject::load_file)