ladybird/Libraries/LibJS
mattco98 95abcc3722 LibJS: Implement correct object property ordering
This commit introduces a way to get an object's own properties in the
correct order. The "correct order" for JS object properties is first all
array-like index properties (numeric keys) sorted by insertion order,
followed by all string properties sorted by insertion order.

Objects also now print correctly in the repl! Before this commit:

courage ~/js-tests $ js
> ({ foo: 1, bar: 2, baz: 3 })
{ bar: 2, foo: 1, baz: 3 }

After:

courage ~/js-tests $ js
> ({ foo: 1, bar: 2, baz: 3 })
{ foo: 1, bar: 2, baz: 3 }
2020-04-29 18:47:03 +02:00
..
Heap LibJS: Add MarkedValueList and use it for argument passing 2020-04-19 17:34:33 +02:00
Runtime LibJS: Implement correct object property ordering 2020-04-29 18:47:03 +02:00
Tests LibJS: Implement correct object property ordering 2020-04-29 18:47:03 +02:00
AST.cpp LibJS: Implement correct object property ordering 2020-04-29 18:47:03 +02:00
AST.h LibJS: Add spreading in object literals 2020-04-28 20:37:21 +02:00
Forward.h LibJS: Add Reference class to represent a base.property reference 2020-04-28 15:07:08 +02:00
Interpreter.cpp LibJS: Pass JS::Function around by reference more 2020-04-29 13:43:57 +02:00
Interpreter.h LibJS: Pass JS::Function around by reference more 2020-04-29 13:43:57 +02:00
Lexer.cpp LibJS: Add spreading in array literals 2020-04-27 11:32:18 +02:00
Lexer.h LibJS: Handle HTML-style comments 2020-04-14 12:54:09 +02:00
Makefile LibJS: Make AssignmentExpression assign through a Reference 2020-04-28 15:07:08 +02:00
Parser.cpp LibJS: Add spreading in object literals 2020-04-28 20:37:21 +02:00
Parser.h LibJS: Parse while statements 2020-04-22 11:48:14 +02:00
Token.cpp LibJS: Add TokenType::TemplateLiteral 2020-04-24 11:18:57 +02:00
Token.h LibJS: Add spreading in array literals 2020-04-27 11:32:18 +02:00