fix intrinsics and env

This commit is contained in:
2026-02-16 23:05:00 -06:00
parent 63955e45ff
commit c9dad91ea1
13 changed files with 94696 additions and 86771 deletions

View File

@@ -267,7 +267,8 @@ static int g_has_native_env = 0;
void cell_rt_set_native_env(JSContext *ctx, JSValue env) {
if (!JS_IsNull(env) && !JS_IsStone(env)) {
fprintf(stderr, "cell_rt_set_native_env: WARNING env not stone\n");
fprintf(stderr, "cell_rt_set_native_env: ERROR env not stone\n");
abort();
}
if (g_has_native_env)
JS_DeleteGCRef(ctx, &g_native_env_ref);
@@ -585,13 +586,6 @@ void cell_rt_disrupt(JSContext *ctx) {
JS_ThrowTypeError(ctx, "type error in native code");
}
/* --- set_var: set a variable in env_record or global --- */
void cell_rt_set_var(JSContext *ctx, JSValue val, const char *name) {
JSValue key = JS_NewString(ctx, name);
JS_SetProperty(ctx, ctx->global_obj, key, val);
}
/* --- in: key in obj --- */
JSValue cell_rt_in(JSContext *ctx, JSValue key, JSValue obj) {