Add Date class.

Missing setXXX functions.
This commit is contained in:
Tor Andersson
2014-01-27 22:40:52 +01:00
parent ac953db0f7
commit de3aa34aed
4 changed files with 703 additions and 0 deletions

View File

@@ -75,6 +75,7 @@ void jsB_init(js_State *J)
J->Boolean_prototype = jsV_newobject(J, JS_CBOOLEAN, J->Object_prototype);
J->Number_prototype = jsV_newobject(J, JS_CNUMBER, J->Object_prototype);
J->String_prototype = jsV_newobject(J, JS_CSTRING, J->Object_prototype);
J->Date_prototype = jsV_newobject(J, JS_CDATE, J->Object_prototype);
/* All the native error types */
J->Error_prototype = jsV_newobject(J, JS_CERROR, J->Object_prototype);
@@ -94,6 +95,7 @@ void jsB_init(js_State *J)
jsB_initstring(J);
jsB_initerror(J);
jsB_initmath(J);
jsB_initdate(J);
/* Initialize the global object */
js_pushnumber(J, NAN);

View File

@@ -10,6 +10,7 @@ void jsB_initnumber(js_State *J);
void jsB_initstring(js_State *J);
void jsB_initerror(js_State *J);
void jsB_initmath(js_State *J);
void jsB_initdate(js_State *J);
void jsB_propf(js_State *J, const char *name, js_CFunction cfun, int n);
void jsB_propn(js_State *J, const char *name, double number);

699
jsdate.c Normal file

File diff suppressed because it is too large Load Diff

1
jsi.h
View File

@@ -97,6 +97,7 @@ struct js_State
js_Object *Boolean_prototype;
js_Object *Number_prototype;
js_Object *String_prototype;
js_Object *Date_prototype;
js_Object *Error_prototype;
js_Object *EvalError_prototype;