Linus Groh
476094922b
LibJS: Pass Interpreter& to Value::to_number() et al.
...
This patch is unfortunately rather large and might make some things feel
bloated, but it is necessary to fix a few flaws in LibJS, primarily
blindly coercing values to numbers without exception checks - i.e.
interpreter.argument(0).to_i32(); // can fail!!!
Some examples where the interpreter would actually crash:
var o = { toString: () => { throw Error() } };
+o;
o - 1;
"foo".charAt(o);
"bar".repeat(o);
To fix this, we now have the following...
to_double(Interpreter&)
to_i32()
to_i32(Interpreter&)
to_size_t()
to_size_t(Interpreter&)
...and a whole lot of exception checking.
There's intentionally no to_double(), use as_double() directly instead.
This way we still can use these convenient utility functions but don't
need to check for exceptions if we are sure the value already is a
number.
Fixes #2267 .
2020-05-18 09:39:55 +02:00
..
2020-05-18 09:39:55 +02:00
2020-04-23 09:47:23 +02:00
2020-05-08 20:06:49 +02:00
2020-05-08 20:06:49 +02:00
2020-05-18 09:39:55 +02:00
2020-04-28 13:11:10 +02:00
2020-04-28 09:29:50 +02:00
2020-04-07 17:25:50 +02:00
2020-04-18 13:24:45 +02:00
2020-04-18 10:28:22 +02:00
2020-05-05 09:15:16 +02:00
2020-04-10 13:09:35 +02:00
2020-04-28 09:29:50 +02:00
2020-04-21 12:23:07 +02:00
2020-04-29 18:47:03 +02:00
2020-04-29 18:47:03 +02:00
2020-05-05 09:15:16 +02:00
2020-05-02 11:41:35 +02:00
2020-04-18 13:24:45 +02:00
2020-04-18 10:28:22 +02:00
2020-04-28 09:29:50 +02:00
2020-04-01 20:18:36 +02:00
2020-05-18 09:39:55 +02:00
2020-03-30 21:43:35 +02:00
2020-05-05 09:15:16 +02:00
2020-04-18 10:28:22 +02:00
2020-05-15 13:50:42 +02:00
2020-04-10 14:06:52 +02:00
2020-05-18 09:39:55 +02:00
2020-04-13 11:19:53 +02:00
2020-03-24 22:21:58 +01:00
2020-03-24 22:21:58 +01:00
2020-05-18 09:39:55 +02:00
2020-04-29 12:41:58 +02:00
2020-05-15 13:50:42 +02:00
2020-04-04 15:58:49 +02:00
2020-05-18 09:39:55 +02:00
2020-04-18 10:28:22 +02:00
2020-05-18 09:39:55 +02:00
2020-05-17 16:21:33 +02:00
2020-04-16 16:10:38 +02:00
2020-04-15 22:07:20 +02:00
2020-05-05 09:15:16 +02:00
2020-04-19 17:34:33 +02:00
2020-05-18 09:39:55 +02:00
2020-04-23 19:38:13 +02:00
2020-04-18 13:24:45 +02:00
2020-04-18 10:28:22 +02:00
2020-04-18 11:00:55 +02:00
2020-03-29 00:37:33 +01:00
2020-05-18 09:39:55 +02:00
2020-04-26 20:36:59 +02:00
2020-04-18 13:24:45 +02:00
2020-04-18 10:28:22 +02:00
2020-04-18 13:24:45 +02:00
2020-04-10 13:09:35 +02:00
2020-05-15 13:50:42 +02:00
2020-05-17 18:05:15 +02:00
2020-05-18 09:39:55 +02:00
2020-04-30 09:53:16 +02:00
2020-05-18 09:39:55 +02:00
2020-04-18 10:28:22 +02:00
2020-04-04 12:58:05 +02:00
2020-04-04 12:58:05 +02:00
2020-04-28 15:07:08 +02:00
2020-05-18 09:39:55 +02:00
2020-04-28 15:07:08 +02:00
2020-05-18 09:39:55 +02:00
2020-05-01 16:54:01 +02:00
2020-05-18 09:39:55 +02:00
2020-05-06 17:40:56 +02:00
2020-04-29 18:47:03 +02:00
2020-04-29 18:47:03 +02:00
2020-05-18 09:39:55 +02:00
2020-05-07 23:05:55 +02:00
2020-04-18 13:24:45 +02:00
2020-04-29 12:33:28 +02:00
2020-05-18 09:39:55 +02:00
2020-05-01 16:50:37 +02:00
2020-05-17 18:05:15 +02:00
2020-05-17 18:05:15 +02:00
2020-05-17 18:05:15 +02:00
2020-05-17 18:05:15 +02:00
2020-05-17 18:05:15 +02:00
2020-05-17 18:05:15 +02:00
2020-05-18 09:39:55 +02:00
2020-05-18 09:36:14 +02:00
2020-05-18 09:39:55 +02:00
2020-05-01 16:54:01 +02:00
2020-05-18 09:39:55 +02:00
2020-05-18 09:39:55 +02:00