1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 18:27:35 +00:00

LibJS: Make Object.prototype.toString() fully spec compliant

- Fix evaluation order: IsArray(O) should always be called and before
  Get(O, @@toStringTag), previously it was the other way around and
  IsArray would only be called if @@toStringTag is not a string
- Add missing exception checks to both function calls
- Add missing builtin tag for arguments object

Also, while we're here:
- Update variable names to match spec
- Add spec step comments
This commit is contained in:
Linus Groh 2021-07-05 18:31:56 +01:00
parent e1906d74b8
commit 339ccba354
5 changed files with 87 additions and 36 deletions

View file

@ -18,6 +18,7 @@ ArgumentsObject::ArgumentsObject(GlobalObject& global_object, Environment& envir
void ArgumentsObject::initialize(GlobalObject& global_object)
{
Base::initialize(global_object);
set_has_parameter_map();
m_parameter_map = Object::create(global_object, nullptr);
}