mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 19:47:44 +00:00
LibJS: Reorder and add missing name & length properties to Built-ins
The specification dicatates that each built-in will have a length and name property. (defined in that order)
This commit is contained in:
parent
7e4b0681e1
commit
eeb4c1eec9
16 changed files with 32 additions and 29 deletions
|
@ -28,12 +28,12 @@ void StringConstructor::initialize(GlobalObject& global_object)
|
|||
// 22.1.2.3 String.prototype, https://tc39.es/ecma262/#sec-string.prototype
|
||||
define_direct_property(vm.names.prototype, global_object.string_prototype(), 0);
|
||||
|
||||
define_direct_property(vm.names.length, Value(1), Attribute::Configurable);
|
||||
|
||||
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_direct_property(vm.names.length, Value(1), Attribute::Configurable);
|
||||
}
|
||||
|
||||
StringConstructor::~StringConstructor()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue