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
..
2020-03-08 13:06:51 +01:00
2020-02-10 14:04:27 +01:00
2020-04-26 12:54:22 +02:00
2020-02-16 09:41:56 +01:00
2020-02-18 13:29:54 +01:00
2020-03-18 08:17:01 +01:00
2020-01-18 09:45:54 +01:00
2020-04-04 19:29:30 +02:00
2020-02-16 09:51:49 +01:00
2020-04-04 19:29:30 +02:00
2020-02-06 15:04:03 +01:00
2020-02-18 11:35:47 +01:00
2020-03-20 14:41:23 +01:00
2020-03-07 01:33:53 +01:00
2020-03-06 22:46:17 +01:00
2020-03-11 10:12:36 +01:00
2020-03-19 15:48:00 +01:00
2020-03-31 09:08:30 +02:00
2020-04-11 13:24:55 +02:00
2020-03-08 13:06:51 +01:00
2020-02-20 13:20:34 +01:00
2020-03-04 18:06:17 +01:00
2020-02-18 11:35:47 +01:00
2020-02-18 13:29:54 +01:00
2020-01-18 09:45:54 +01:00
2020-01-18 09:45:54 +01:00
2020-04-06 11:09:01 +02:00
2020-04-16 11:17:33 +02:00
2020-02-25 14:52:35 +01:00
2020-03-08 13:06:51 +01:00
2020-02-20 15:12:55 +01:00
2020-04-26 12:59:09 +02:00
2020-04-21 16:19:18 +02:00
2020-02-06 15:04:03 +01:00
2020-03-15 19:09:31 +01:00
2020-02-11 12:16:07 +01:00
2020-04-29 18:47:03 +02:00
2020-02-06 15:04:03 +01:00
2020-04-26 12:54:10 +02:00
2020-02-06 15:04:03 +01:00
2020-02-18 13:29:54 +01:00
2020-04-25 12:09:46 +02:00
2020-03-06 11:19:51 +01:00
2020-02-20 15:13:42 +01:00
2020-04-16 11:17:33 +02:00
2020-04-28 21:04:25 +02:00
2020-04-28 21:04:25 +02:00
2020-04-28 09:36:09 +02:00
2020-01-27 21:38:36 +01:00
2020-01-18 09:45:54 +01:00
2020-01-18 09:45:54 +01:00
2020-02-08 15:50:00 +01:00
2020-04-06 15:36:36 +02:00
2020-02-21 15:16:28 +01:00
2020-01-18 09:45:54 +01:00
2020-02-06 15:04:03 +01:00
2020-03-29 19:37:23 +02:00
2020-04-19 11:14:26 +02:00
2020-03-07 01:33:53 +01:00
2020-02-06 20:33:02 +01:00
2020-03-08 13:06:51 +01:00
2020-01-18 09:45:54 +01:00
2020-04-04 20:01:36 +02:00
2020-02-22 11:01:37 +01:00
2020-03-01 17:46:06 +01:00
2020-01-18 09:45:54 +01:00
2020-02-18 13:29:54 +01:00
2020-01-18 09:45:54 +01:00
2020-03-01 12:11:31 +01:00
2020-02-18 11:35:47 +01:00
2020-02-06 15:04:03 +01:00
2020-03-08 13:06:51 +01:00
2020-03-08 13:06:51 +01:00
2020-03-09 12:37:49 +01:00
2020-04-13 00:53:22 +02:00
2020-03-08 13:06:51 +01:00
2020-01-18 09:45:54 +01:00
2020-03-08 13:06:51 +01:00
2020-03-07 01:33:53 +01:00
2020-03-07 01:33:53 +01:00
2020-02-25 14:52:35 +01:00
2020-01-29 12:56:07 +01:00
2020-04-19 18:07:16 +02:00
2020-04-06 11:09:01 +02:00
2020-03-03 16:02:58 +01:00
2020-02-18 13:29:54 +01:00
2020-01-18 09:45:54 +01:00
2020-01-18 09:45:54 +01:00
2020-02-23 06:46:38 +01:00
2020-01-18 09:45:54 +01:00
2020-01-18 09:45:54 +01:00
2020-02-06 15:04:03 +01:00
2020-03-25 15:48:35 +01:00
2020-02-18 13:29:54 +01:00
2020-02-06 15:04:03 +01:00
2020-03-02 14:24:25 +01:00
2020-02-18 11:35:47 +01:00
2020-02-18 11:35:47 +01:00
2020-02-18 11:35:47 +01:00
2020-02-18 11:35:47 +01:00