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.
4 lines
54 B
Plaintext
4 lines
54 B
Plaintext
class Foo {
|
|
static foreign method // expect error
|
|
}
|