MIRROR: javascript for ๐Ÿœ's, a tiny runtime with big ambitions
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

run self-lint

+13 -13
+13 -13
src/ant.c
··· 2290 2290 2291 2291 static size_t tostr(struct js *js, jsval_t value, char *buf, size_t len) { 2292 2292 switch (vtype(value)) { 2293 - case T_UNDEF: return cpy(buf, len, "undefined", 9); 2294 - case T_NULL: return cpy(buf, len, "null", 4); 2295 - case T_BOOL: return cpy(buf, len, vdata(value) & 1 ? "true" : "false", vdata(value) & 1 ? 4 : 5); 2296 - case T_ARR: return strarr(js, value, buf, len); 2297 - case T_OBJ: return strobj(js, value, buf, len); 2298 - case T_STR: return strstring(js, value, buf, len); 2299 - case T_NUM: return strnum(value, buf, len); 2300 - case T_BIGINT: return strbigint(js, value, buf, len); 2293 + case T_UNDEF: return cpy(buf, len, "undefined", 9); 2294 + case T_NULL: return cpy(buf, len, "null", 4); 2295 + case T_BOOL: return cpy(buf, len, vdata(value) & 1 ? "true" : "false", vdata(value) & 1 ? 4 : 5); 2296 + case T_ARR: return strarr(js, value, buf, len); 2297 + case T_OBJ: return strobj(js, value, buf, len); 2298 + case T_STR: return strstring(js, value, buf, len); 2299 + case T_NUM: return strnum(value, buf, len); 2300 + case T_BIGINT: return strbigint(js, value, buf, len); 2301 2301 case T_PROMISE: return strpromise(js, value, buf, len); 2302 - case T_FUNC: return strfunc(js, value, buf, len); 2303 - case T_CFUNC: return cpy(buf, len, "[native code]", 13); 2304 - case T_FFI: return cpy(buf, len, "[native code]", 13); 2305 - case T_PROP: return (size_t) snprintf(buf, len, "PROP@%lu", (unsigned long) vdata(value)); 2306 - default: return (size_t) snprintf(buf, len, "VTYPE%d", vtype(value)); 2302 + case T_FUNC: return strfunc(js, value, buf, len); 2303 + case T_CFUNC: return cpy(buf, len, "[native code]", 13); 2304 + case T_FFI: return cpy(buf, len, "[native code]", 13); 2305 + case T_PROP: return (size_t) snprintf(buf, len, "PROP@%lu", (unsigned long) vdata(value)); 2306 + default: return (size_t) snprintf(buf, len, "VTYPE%d", vtype(value)); 2307 2307 } 2308 2308 } 2309 2309