- Timestamp:
- Sep 13, 2018, 3:51:18 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/prototype-v0/zoo-project/zoo-kernel/service_internal_js.c
r863 r882 157 157 return 1; 158 158 if (!JS_DefineFunction(cx, global, "alert", JSAlert, 2, 0)) 159 return 1; 160 if (!JS_DefineFunction(cx, global, "sleep", JSSleep, 1, 0)) 159 161 return 1; 160 162 if (!JS_DefineFunction(cx, global, "importScripts", JSLoadScripts, 1, 0)) … … 1027 1029 } 1028 1030 1031 /** 1032 * The function used as sleep from the JavaScript environment 1033 * (ZOO-API). 1034 * 1035 * @param cx the JavaScript context 1036 * @param argc the number of parameters 1037 * @param argv1 the parameter values 1038 * @return true 1039 */ 1040 JSBool 1041 JSSleep(JSContext *cx, uintN argc, jsval *argv1) 1042 { 1043 jsval *argv = JS_ARGV(cx,argv1); 1044 JS_MaybeGC(cx); 1045 int isleep=0; 1046 if(JS_ValueToInt32(cx,argv[0],&isleep)==JS_TRUE){ 1047 zSleep(isleep); 1048 } 1049 JS_MaybeGC(cx); 1050 return JS_TRUE; 1051 } 1052
Note: See TracChangeset
for help on using the changeset viewer.