refactor: extract Meta class into separate module and add eval method with compile support

This commit is contained in:
Bob Nystrom
2015-10-16 01:08:56 +00:00
parent 419a5dfda0
commit c65fdb2f94
11 changed files with 119 additions and 99 deletions
+13 -1
View File
@@ -1 +1,13 @@
class Meta {}
class Meta {
static eval(source) {
if (!(source is String)) Fiber.abort("Source code must be a string.")
var fn = compile_(source)
// TODO: Include compile errors.
if (fn == null) Fiber.abort("Could not compile source code.")
Fiber.new(fn).call()
}
foreign static compile_(source)
}