Linus Groh
00b8ce4a6d
LibJS: Pass this value to fallback func in Array.prototype.toString()
...
The existing code looks innocently correct, implementing the following
step:
3. If IsCallable(func) is false, set func to the intrinsic function
%Object.prototype.toString%.
as
return ObjectPrototype::to_string(vm, global_object);
However, this misses the fact that the next step calls the function with
the previously ToObject()'d this value (`array`):
4. Return ? Call(func, array).
This doesn't happen in the current implementation, which will use the
unaltered this value from the Array.prototype.toString() call, and make
another, unequal object in %Object.prototype.toString%. Since both that
and Array.prototype.toString() do a Get() call on said object, this
behavior is observable (see newly added test).
Fix this by actually doing what the spec says and calling the fallback
function the regular way.
2022-04-12 00:23:27 +01:00
..
2022-04-06 20:58:12 -04:00
2022-04-11 23:47:02 +01:00
2022-04-11 21:34:57 +01:00
2022-02-14 21:06:49 +00:00
2022-03-19 00:20:46 +00:00
2022-03-16 16:19:40 +00:00
2022-03-16 16:19:40 +00:00
2022-03-16 16:19:40 +00:00
2022-03-16 16:19:40 +00:00
2022-04-08 11:15:16 +01:00
2022-04-08 11:15:16 +01:00
2022-03-16 16:19:40 +00:00
2022-03-16 16:19:40 +00:00
2022-03-16 16:19:40 +00:00
2022-03-16 16:19:40 +00:00
2022-03-16 16:19:40 +00:00
2022-03-16 16:19:40 +00:00
2022-03-16 16:19:40 +00:00
2022-03-16 16:19:40 +00:00
2022-03-16 16:19:40 +00:00
2022-03-16 16:19:40 +00:00
2022-04-12 00:23:27 +01:00
2022-03-16 16:19:40 +00:00
2022-02-20 23:21:40 +00:00
2022-02-19 18:06:39 +00:00
2022-03-16 16:19:40 +00:00
2022-03-16 16:19:40 +00:00
2022-02-19 22:16:30 +00:00
2022-02-08 23:08:43 +00:00
2022-03-16 16:19:40 +00:00
2022-04-01 21:24:45 +01:00
2022-03-16 16:19:40 +00:00
2022-03-16 16:19:40 +00:00
2022-03-16 16:19:40 +00:00
2022-03-16 16:19:40 +00:00
2022-03-16 16:19:40 +00:00
2022-03-16 16:19:40 +00:00
2022-03-16 16:19:40 +00:00
2022-03-16 16:19:40 +00:00
2022-03-16 16:19:40 +00:00
2022-03-16 16:19:40 +00:00
2022-04-01 21:24:45 +01:00
2022-03-16 16:19:40 +00:00
2022-04-11 19:44:56 +01:00
2022-04-01 21:24:45 +01:00
2022-02-14 23:02:56 +00:00
2022-03-02 20:53:18 +01:00
2022-02-28 23:22:35 +00:00
2022-03-31 09:25:17 -04:00
2022-03-16 16:19:40 +00:00
2022-03-16 16:19:40 +00:00
2022-03-16 16:19:40 +00:00
2022-03-16 16:19:40 +00:00
2022-03-16 16:19:40 +00:00
2022-03-16 16:19:40 +00:00
2022-03-16 16:19:40 +00:00
2022-03-16 16:19:40 +00:00
2022-03-16 16:19:40 +00:00
2022-03-16 16:19:40 +00:00
2022-04-01 21:24:45 +01:00
2022-03-16 16:19:40 +00:00
2022-03-18 23:48:50 +00:00
2022-03-16 16:19:40 +00:00
2022-03-16 16:19:40 +00:00
2022-03-16 16:19:40 +00:00
2022-04-11 21:32:37 +01:00
2022-04-11 21:23:36 +01:00
2022-03-19 00:20:46 +00:00
2022-02-08 18:17:12 +00:00
2022-02-08 09:12:42 +00:00
2022-03-15 17:32:48 +01:00
2022-03-15 17:32:48 +01:00
2022-03-08 22:59:09 +01:00
2022-04-08 11:15:16 +01:00
2022-02-09 12:25:27 +00:00
2022-04-03 15:19:33 +01:00
2022-04-03 15:19:33 +01:00
2022-04-11 21:32:37 +01:00
2022-03-16 16:19:40 +00:00
2022-03-16 16:19:40 +00:00
2022-03-16 16:19:40 +00:00
2022-04-11 21:23:36 +01:00
2022-03-16 16:19:40 +00:00
2022-03-16 16:19:40 +00:00
2022-03-16 16:19:40 +00:00
2022-03-16 16:19:40 +00:00
2022-04-01 21:24:45 +01:00
2022-03-16 16:19:40 +00:00
2022-03-16 16:19:40 +00:00
2022-03-16 16:19:40 +00:00
2022-03-16 16:19:40 +00:00
2022-03-16 16:19:40 +00:00
2022-03-16 16:19:40 +00:00
2022-04-03 15:19:33 +01:00
2022-03-16 16:19:40 +00:00
2022-03-16 16:19:40 +00:00
2022-03-16 16:19:40 +00:00
2022-04-12 00:23:27 +01:00
2022-04-12 00:23:27 +01:00
2022-04-01 21:24:45 +01:00
2022-04-01 21:24:45 +01:00
2022-02-18 13:57:34 +00:00
2022-02-18 13:57:34 +00:00
2022-02-09 12:25:27 +00:00
2022-03-16 16:19:40 +00:00
2022-03-16 16:19:40 +00:00
2022-02-09 12:25:27 +00:00
2022-04-03 15:19:33 +01:00
2022-04-01 21:24:45 +01:00
2022-03-16 16:19:40 +00:00
2022-03-16 16:19:40 +00:00
2022-03-16 16:19:40 +00:00
2022-03-16 16:19:40 +00:00
2022-03-16 16:19:40 +00:00
2022-03-16 16:19:40 +00:00
2022-03-16 16:19:40 +00:00
2022-03-16 16:19:40 +00:00
2022-03-16 16:19:40 +00:00
2022-03-16 16:19:40 +00:00
2022-03-16 16:19:40 +00:00
2022-03-16 16:19:40 +00:00
2022-02-07 19:16:46 +01:00
2022-02-09 12:25:27 +00:00
2022-02-09 12:25:27 +00:00
2022-04-01 21:24:45 +01:00
2022-04-01 21:24:45 +01:00
2022-04-01 21:24:45 +01:00
2022-03-16 16:19:40 +00:00
2022-03-16 16:19:40 +00:00
2022-03-16 16:19:40 +00:00
2022-03-18 19:58:57 +01:00
2022-03-16 16:19:40 +00:00
2022-04-01 21:24:45 +01:00
2022-04-01 21:24:45 +01:00
2022-03-16 16:19:40 +00:00
2022-03-16 16:19:40 +00:00
2022-02-08 09:12:42 +00:00
2022-03-16 16:19:40 +00:00
2022-03-16 16:19:40 +00:00
2022-02-15 00:51:25 +00:00
2022-03-19 00:20:46 +00:00
2022-03-19 00:20:46 +00:00
2022-02-08 17:47:44 +00:00
2022-02-08 17:47:44 +00:00
2022-02-08 09:12:42 +00:00
2022-04-03 15:19:33 +01:00
2022-02-08 17:47:44 +00:00
2022-02-20 23:21:40 +00:00
2022-02-20 23:21:40 +00:00
2022-04-01 21:24:45 +01:00
2022-03-19 00:20:46 +00:00
2022-03-19 00:20:46 +00:00
2022-04-01 21:24:45 +01:00
2022-03-16 16:19:40 +00:00
2022-03-16 16:19:40 +00:00
2022-03-16 16:19:40 +00:00
2022-04-01 21:24:45 +01:00
2022-04-01 21:24:45 +01:00
2022-02-07 19:16:46 +01:00
2022-03-19 00:20:46 +00:00
2022-02-13 14:30:26 +00:00
2022-03-16 16:19:40 +00:00
2022-03-16 16:19:40 +00:00
2022-03-16 16:19:40 +00:00
2022-03-16 16:19:40 +00:00
2022-03-16 16:19:40 +00:00
2022-03-16 16:19:40 +00:00
2022-04-01 21:24:45 +01:00
2022-03-17 11:29:51 -04:00
2022-03-16 16:19:40 +00:00
2022-03-16 16:19:40 +00:00
2022-03-16 16:19:40 +00:00
2022-03-16 16:19:40 +00:00
2022-03-16 16:19:40 +00:00
2022-03-16 16:19:40 +00:00
2022-03-16 16:19:40 +00:00
2022-03-16 16:19:40 +00:00
2022-03-16 16:19:40 +00:00
2022-03-16 16:19:40 +00:00
2022-03-16 16:19:40 +00:00
2022-04-03 15:19:33 +01:00
2022-02-12 16:06:37 +00:00
2022-03-29 23:48:25 +01:00
2022-04-01 21:24:45 +01:00
2022-04-01 21:24:45 +01:00
2022-04-01 21:24:45 +01:00
2022-03-16 16:19:40 +00:00
2022-03-16 16:19:40 +00:00
2022-03-16 16:19:40 +00:00
2022-03-16 16:19:40 +00:00
2022-03-16 16:19:40 +00:00
2022-03-16 16:19:40 +00:00
2022-03-16 16:19:40 +00:00
2022-04-06 20:58:12 -04:00
2022-03-16 16:19:40 +00:00
2022-03-16 16:19:40 +00:00
2022-04-01 21:24:45 +01:00
2022-03-16 16:19:40 +00:00
2022-03-16 16:19:40 +00:00
2022-03-16 16:19:40 +00:00
2022-04-01 21:24:45 +01:00
2022-03-16 16:19:40 +00:00
2022-03-16 16:19:40 +00:00
2022-04-01 21:24:45 +01:00
2022-04-01 21:24:45 +01:00
2022-04-01 21:24:45 +01:00
2022-04-01 21:24:45 +01:00
2022-04-08 11:15:16 +01:00
2022-03-16 16:19:40 +00:00
2022-04-03 15:19:33 +01:00
2022-04-01 21:24:45 +01:00
2022-04-02 14:15:43 +01:00
2022-04-11 21:23:36 +01:00
2022-04-11 21:23:36 +01:00
2022-03-16 16:19:40 +00:00
2022-03-16 16:19:40 +00:00
2022-03-16 16:19:40 +00:00
2022-03-16 16:19:40 +00:00
2022-03-16 16:19:40 +00:00
2022-03-16 16:19:40 +00:00
2022-03-16 16:19:40 +00:00
2022-03-16 16:19:40 +00:00
2022-03-16 16:19:40 +00:00
2022-03-16 16:19:40 +00:00
2022-03-16 16:19:40 +00:00
2022-03-16 16:19:40 +00:00
2022-03-16 16:19:40 +00:00
2022-03-16 16:19:40 +00:00
2022-03-16 16:19:40 +00:00
2022-03-16 16:19:40 +00:00
2022-03-16 16:19:40 +00:00
2022-03-16 16:19:40 +00:00
2022-02-12 16:06:37 +00:00
2022-02-09 12:25:27 +00:00