Merge branch 'gen_dylib'
This commit is contained in:
@@ -22,30 +22,6 @@ function use_embed(name) {
|
||||
return load_internal("js_core_" + name + "_use")
|
||||
}
|
||||
|
||||
function logical(val1) {
|
||||
if (val1 == 0 || val1 == false || val1 == "false" || val1 == null)
|
||||
return false;
|
||||
if (val1 == 1 || val1 == true || val1 == "true")
|
||||
return true;
|
||||
return null;
|
||||
}
|
||||
|
||||
function some(arr, pred) {
|
||||
return find(arr, pred) != null
|
||||
}
|
||||
|
||||
function every(arr, pred) {
|
||||
return find(arr, x => not(pred(x))) == null
|
||||
}
|
||||
|
||||
function starts_with(str, prefix) {
|
||||
return search(str, prefix) == 0
|
||||
}
|
||||
|
||||
function ends_with(str, suffix) {
|
||||
return search(str, suffix, -length(suffix)) != null
|
||||
}
|
||||
|
||||
var fd = use_embed('internal_fd')
|
||||
var js = use_embed('js')
|
||||
var crypto = use_embed('crypto')
|
||||
@@ -84,7 +60,7 @@ function boot_load(name) {
|
||||
}
|
||||
mcode_blob = fd.slurp(mcode_path)
|
||||
mach_blob = mach_compile_mcode_bin(name, text(mcode_blob))
|
||||
return mach_load(mach_blob, {use: use_embed})
|
||||
return mach_load(mach_blob, stone({use: use_embed}))
|
||||
}
|
||||
|
||||
// Load a pipeline module from cache; on miss compile from source via boot chain
|
||||
@@ -149,7 +125,7 @@ function load_pipeline_module(name, env) {
|
||||
}
|
||||
|
||||
// Load compilation pipeline
|
||||
var pipeline_env = {use: use_embed}
|
||||
var pipeline_env = stone({use: use_embed})
|
||||
var tokenize_mod = load_pipeline_module('tokenize', pipeline_env)
|
||||
var parse_mod = load_pipeline_module('parse', pipeline_env)
|
||||
var fold_mod = load_pipeline_module('fold', pipeline_env)
|
||||
@@ -270,6 +246,7 @@ function use_core(path) {
|
||||
// Build env: merge core_extras
|
||||
env = {use: use_core}
|
||||
arrfor(array(core_extras), function(k) { env[k] = core_extras[k] })
|
||||
env = stone(env)
|
||||
|
||||
var hash = null
|
||||
var cached_path = null
|
||||
@@ -447,12 +424,6 @@ var parallel = pronto.parallel
|
||||
var race = pronto.race
|
||||
var sequence = pronto.sequence
|
||||
|
||||
// Fill runtime_env (same object reference shop holds)
|
||||
runtime_env.logical = logical
|
||||
runtime_env.some = some
|
||||
runtime_env.every = every
|
||||
runtime_env.starts_with = starts_with
|
||||
runtime_env.ends_with = ends_with
|
||||
runtime_env.actor = actor
|
||||
runtime_env.is_actor = is_actor
|
||||
runtime_env.log = log
|
||||
@@ -1109,6 +1080,7 @@ $_.clock(_ => {
|
||||
}
|
||||
env.args = _cell.args.arg
|
||||
env.log = log
|
||||
env = stone(env)
|
||||
|
||||
var source_blob = fd.slurp(prog_path)
|
||||
var hash = content_hash(source_blob)
|
||||
|
||||
Reference in New Issue
Block a user