mirror of
https://github.com/wren-lang/wren.git
synced 2026-01-18 13:49:59 +01:00
Move Meta to a separate module.
Also cleaned up some of the code around loading the core module.
This commit is contained in:
@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user