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:
@@ -0,0 +1,3 @@
|
||||
class Foo {
|
||||
static foreign method // expect error
|
||||
}
|
||||
Reference in New Issue
Block a user