mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 07:08:10 +00:00
LibJS: Remove String.prototype.length
A string's length property is supposed to be a regular non-writable, non-enumerable, non-configurable property on the StringObject instead.
This commit is contained in:
parent
fc2673d111
commit
8d7ec28924
5 changed files with 11 additions and 12 deletions
|
@ -1,5 +1,6 @@
|
|||
/*
|
||||
* Copyright (c) 2020, Andreas Kling <kling@serenityos.org>
|
||||
* Copyright (c) 2021, Linus Groh <linusg@serenityos.org>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
@ -25,6 +26,13 @@ StringObject::~StringObject()
|
|||
{
|
||||
}
|
||||
|
||||
void StringObject::initialize(GlobalObject& global_object)
|
||||
{
|
||||
auto& vm = this->vm();
|
||||
Object::initialize(global_object);
|
||||
define_property(vm.names.length, Value(m_string.string().length()), 0);
|
||||
}
|
||||
|
||||
void StringObject::visit_edges(Cell::Visitor& visitor)
|
||||
{
|
||||
Object::visit_edges(visitor);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue