feat: generate runtime error when foreign method is not found

Change bindMethod return type from void to Value to propagate error string when a foreign method's C function pointer is NULL. The call site in runInterpreter now checks for a string error and triggers a runtime error, preventing silent failures on missing foreign bindings.

Add three test cases: foreign method after static declaration, foreign method with a body, and unknown foreign method that expects the new runtime error message.
This commit is contained in:
Bob Nystrom
2015-03-26 14:17:09 +00:00
parent 83e062cc71
commit 26ae448adf
4 changed files with 28 additions and 2 deletions
@@ -0,0 +1,3 @@
class Foo {
static foreign method // expect error
}