shithub: libmujs

ref: a4cc139e1cb81fc53b88b72fe8d15b9ac43d2ef4
dir: /jsvalue.h/

View raw version
#ifndef js_value_h
#define js_value_h

enum js_ValueType {
	JS_TUNDEFINED,
	JS_TNULL,
	JS_TBOOLEAN,
	JS_TNUMBER,
	JS_TSTRING,
	JS_TREGEXP,
	JS_TOBJECT,
	JS_TCLOSURE,
	JS_TCFUNCTION,
	JS_TREFERENCE,	/* l-value from aval/aindex/amember */
};

struct js_Value
{
	union {
		int boolean;
		double number;
		const char *string;
		struct {
			const char *prog;
			unsigned char flags;
		} regexp;
		js_Object *object;
		js_Closure *closure;
		js_CFunction *cfunction;
		js_Property *reference;
	} u;
	js_ValueType type;
};

void jsC_dumpvalue(js_State *J, js_Value v);

#endif