···1440014400 case T_NUM: return JS_NUM;
1440114401 case T_ERR: return JS_ERR;
1440214402 case T_PROMISE: return JS_PROMISE;
1440314403- case T_OBJ: return JS_OBJ;
1440314403+ case T_OBJ:
1440414404+ case T_ARR: return JS_OBJ;
1440514405+ case T_FUNC: return JS_FUNC;
1440414406 default: return JS_PRIV;
1440514407 }
1440614408}
+2-2
src/modules/events.c
···9191 return js_mkerr(js, "eventType must be a string");
9292 }
93939494- if (js_type(args[1]) != JS_PRIV) {
9494+ if (js_type(args[1]) != JS_FUNC) {
9595 return js_mkerr(js, "listener must be a function");
9696 }
9797···130130 return js_mkerr(js, "eventType must be a string");
131131 }
132132133133- if (js_type(args[1]) != JS_PRIV) {
133133+ if (js_type(args[1]) != JS_FUNC) {
134134 return js_mkerr(js, "listener must be a function");
135135 }
136136
+2-2
src/modules/json.c
···9797 return yyjson_mut_strncpy(doc, str, len);
9898 }
9999100100- case JS_PRIV: {
100100+ case JS_OBJ: {
101101 jsval_t length_val = js_get(js, val, "length");
102102103103 if (js_type(length_val) == JS_NUM) {
···123123124124 while (js_prop_iter_next(&iter, &key, &key_len, &prop_value)) {
125125 if (key_len > 2 && key[0] == '_' && key[1] == '_') continue;
126126- if (js_type(prop_value) == JS_PRIV) {
126126+ if (js_type(prop_value) == JS_OBJ) {
127127 jsval_t code = js_get(js, prop_value, "__code");
128128 if (js_type(code) == JS_STR) continue;
129129 }
+1-1
src/modules/path.c
···333333// path.format(pathObject)
334334static jsval_t builtin_path_format(struct js *js, jsval_t *args, int nargs) {
335335 if (nargs < 1) return js_mkerr(js, "format() requires a path object argument");
336336- if (js_type(args[0]) != JS_PRIV) return js_mkerr(js, "format() argument must be an object");
336336+ if (js_type(args[0]) != JS_OBJ) return js_mkerr(js, "format() argument must be an object");
337337338338 jsval_t obj = args[0];
339339
+3-3
src/modules/shell.c
···7272 (void)nargs;
73737474 jsval_t this_val = js_getthis(js);
7575- if (js_type(this_val) != JS_PRIV) {
7575+ if (js_type(this_val) != JS_OBJ) {
7676 return js_mkerr(js, "text() must be called on a shell result");
7777 }
7878···8585 (void)nargs;
86868787 jsval_t this_val = js_getthis(js);
8888- if (js_type(this_val) != JS_PRIV) return js_mkerr(js, "lines() must be called on a shell result");
8888+ if (js_type(this_val) != JS_OBJ) return js_mkerr(js, "lines() must be called on a shell result");
89899090 jsval_t stdout_val = js_get(js, this_val, "stdout");
9191 if (js_type(stdout_val) != JS_STR) return js_mkerr(js, "No stdout available");
···123123static jsval_t builtin_shell_dollar(struct js *js, jsval_t *args, int nargs) {
124124 if (nargs < 1) return js_mkerr(js, "$() requires at least one argument");
125125126126- if (js_type(args[0]) != JS_PRIV) {
126126+ if (js_type(args[0]) != JS_OBJ) {
127127 if (js_type(args[0]) == JS_STR) {
128128 size_t cmd_len;
129129 char *cmd = js_getstr(js, args[0], &cmd_len);