compiles + runs
This commit is contained in:
2
Makefile
2
Makefile
@@ -58,7 +58,7 @@ static:
|
||||
# Bootstrap: build cell from scratch using meson (only needed once)
|
||||
# Also installs core scripts to ~/.cell/core
|
||||
bootstrap:
|
||||
meson setup build_bootstrap -Dbuildtype=debugoptimized -Db_sanitize=address
|
||||
meson setup build_bootstrap -Dbuildtype=debug -Db_sanitize=address
|
||||
meson compile -C build_bootstrap
|
||||
cp build_bootstrap/cell .
|
||||
cp build_bootstrap/libcell_runtime.dylib .
|
||||
|
||||
@@ -254,6 +254,7 @@ typedef enum JSErrorEnum {
|
||||
JS_REFERENCE_ERROR,
|
||||
JS_SYNTAX_ERROR,
|
||||
JS_TYPE_ERROR,
|
||||
JS_URI_ERROR,
|
||||
JS_INTERNAL_ERROR,
|
||||
JS_AGGREGATE_ERROR,
|
||||
|
||||
@@ -1739,7 +1740,7 @@ static inline int js_resize_array (JSContext *ctx, void **parray, int elem_size,
|
||||
}
|
||||
|
||||
static inline void js_dbuf_init (JSContext *ctx, DynBuf *s) {
|
||||
dbuf_init2 (s, ctx->rt, (DynBufReallocFunc *)js_realloc_rt);
|
||||
dbuf_init2 (s, ctx->rt, NULL);
|
||||
}
|
||||
|
||||
static inline int is_digit (int c) { return c >= '0' && c <= '9'; }
|
||||
@@ -23852,14 +23853,19 @@ void JS_AddIntrinsicBaseObjects (JSContext *ctx) {
|
||||
obj1 = JS_NewCFunctionMagic (ctx, js_error_constructor, "Error", 1, JS_CFUNC_generic_magic, -1);
|
||||
JS_SetPropertyStr (ctx, ctx->global_obj, "Error", obj1);
|
||||
|
||||
for (i = 0; i < JS_NATIVE_ERROR_COUNT; i++) {
|
||||
JSValue func_obj;
|
||||
int n_args;
|
||||
n_args = 1 + (i == JS_AGGREGATE_ERROR);
|
||||
func_obj
|
||||
= JS_NewCFunctionMagic (ctx, js_error_constructor, native_error_name[i], n_args, JS_CFUNC_generic_magic, i);
|
||||
JS_SetPropertyStr (ctx, ctx->global_obj, native_error_name[i], func_obj);
|
||||
}
|
||||
#define REGISTER_ERROR(idx, name) do { \
|
||||
JSValue func_obj = JS_NewCFunctionMagic(ctx, js_error_constructor, name, 1 + ((idx) == JS_AGGREGATE_ERROR), JS_CFUNC_generic_magic, (idx)); \
|
||||
JS_SetPropertyStr(ctx, ctx->global_obj, name, func_obj); \
|
||||
} while(0)
|
||||
REGISTER_ERROR(0, "EvalError");
|
||||
REGISTER_ERROR(1, "RangeError");
|
||||
REGISTER_ERROR(2, "ReferenceError");
|
||||
REGISTER_ERROR(3, "SyntaxError");
|
||||
REGISTER_ERROR(4, "TypeError");
|
||||
REGISTER_ERROR(5, "URIError");
|
||||
REGISTER_ERROR(6, "InternalError");
|
||||
REGISTER_ERROR(7, "AggregateError");
|
||||
#undef REGISTER_ERROR
|
||||
|
||||
/* global properties */
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user