feat: add foreign method binding for Meta class and restrict foreign lookup to core module

Add foreign static eval(source) method to Meta class in meta.wren and implement wrenBindMetaForeignMethod in wren_meta.c to handle its binding. Change the implicit module name from "main" to "core" in wren_vm.c and restrict foreign method lookup to only the "core" module, enabling Meta foreign methods to be resolved alongside IO methods. Relax the IO foreign method binder to return NULL instead of asserting for non-IO classes, allowing fallback to other library binders.
This commit is contained in:
Bob Nystrom
2015-03-26 03:20:26 +00:00
parent 2b3381e0b2
commit 83e062cc71
5 changed files with 40 additions and 13 deletions
+3 -1
View File
@@ -1 +1,3 @@
class Meta {}
class Meta {
foreign static eval(source)
}