comparison spidermonkey-playground.cpp @ 74:ed2cf86a7c9d

Removed spidermonkey-playground.cpp's dependence on string.h.
author Atul Varma <varmaa@toolness.com>
date Thu, 25 Jun 2009 18:56:23 -0700
parents b87b6ebb6e86
children
comparison
equal deleted inserted replaced
73:b87b6ebb6e86 74:ed2cf86a7c9d
36 36
37 // This file is based on the code in the JSAPI User Guide: 37 // This file is based on the code in the JSAPI User Guide:
38 // 38 //
39 // https://developer.mozilla.org/En/SpiderMonkey/JSAPI_User_Guide 39 // https://developer.mozilla.org/En/SpiderMonkey/JSAPI_User_Guide
40 40
41 #include "string.h"
42 #include "jsapi.h" 41 #include "jsapi.h"
43 #include "jsdbgapi.h" 42 #include "jsdbgapi.h"
44 43
45 #include "tcb.h" 44 #include "tcb.h"
46 #include "wrapper.h" 45 #include "wrapper.h"
110 JS_DefineProperty(module_cx, module_global, "exports", 109 JS_DefineProperty(module_cx, module_global, "exports",
111 OBJECT_TO_JSVAL(module_exports), NULL, NULL, 0); 110 OBJECT_TO_JSVAL(module_exports), NULL, NULL, 0);
112 111
113 jsval module_rval; 112 jsval module_rval;
114 if (!JS_EvaluateScript(module_cx, module_global, source, 113 if (!JS_EvaluateScript(module_cx, module_global, source,
115 strlen(source), filename, 1, &module_rval)) { 114 fileSize, filename, 1, &module_rval)) {
116 JS_EndRequest(module_cx); 115 JS_EndRequest(module_cx);
117 JS_DestroyContext(module_cx); 116 JS_DestroyContext(module_cx);
118 return JS_FALSE; 117 return JS_FALSE;
119 } 118 }
120 119