Bob Nystrom
f942da2723
fix: add runtime error when new is called on non-class argument
...
In the interpreter's NEW opcode handler, check if the top-of-stack value is a class before attempting construction. If not, raise a runtime error with a descriptive message instead of silently failing or crashing.
Also add a test case (test/new_on_nonclass.wren) that verifies the error is correctly triggered when calling new on a non-class value like an integer.
2014-03-06 14:51:16 +00:00
..
2014-01-05 20:27:12 +00:00
2014-01-05 20:27:12 +00:00
2014-01-06 16:01:04 +00:00
2014-02-15 04:15:49 +00:00
2014-01-05 20:27:12 +00:00
2014-01-05 20:27:12 +00:00
2014-02-15 19:36:01 +00:00
2014-02-13 16:38:44 +00:00
2014-02-14 15:16:56 +00:00
2014-01-19 21:01:51 +00:00
2014-02-13 16:38:44 +00:00
2014-02-15 19:36:01 +00:00
2014-01-21 02:12:55 +00:00
2014-02-13 01:33:35 +00:00
2014-02-24 03:53:49 +00:00
2014-01-05 20:27:12 +00:00
2014-01-21 15:52:03 +00:00
2014-01-15 15:59:10 +00:00
2014-02-16 17:20:31 +00:00
2014-01-21 02:12:55 +00:00
2014-02-24 03:53:49 +00:00
2014-02-24 15:27:43 +00:00
2014-01-28 23:31:11 +00:00
2014-02-16 17:20:31 +00:00
2014-01-13 03:37:11 +00:00
2014-01-05 20:27:12 +00:00
2014-01-19 21:01:51 +00:00
2014-02-13 16:38:44 +00:00
2014-01-18 01:29:10 +00:00
2014-02-14 14:37:37 +00:00
2014-01-05 20:27:12 +00:00
2014-02-13 16:38:44 +00:00
2014-01-05 20:27:12 +00:00
2014-01-05 20:27:12 +00:00
2014-01-05 20:27:12 +00:00
2014-03-06 14:51:16 +00:00
2014-01-05 20:27:12 +00:00
2014-01-05 20:27:12 +00:00
2014-01-05 20:27:12 +00:00
2014-01-05 20:27:12 +00:00
2014-01-05 20:27:12 +00:00