Slide 17
Slide 17 text
+4#ͷཁ
d9.-)UUQ3FRVFTUΑΓd
JS_BINDED_CONSTRUCTOR_IMPL(MinXmlHttpRequest)
{
MinXmlHttpRequest* req = new MinXmlHttpRequest();
req->autorelease();
js_proxy_t *p;
jsval out;
JSObject *obj = JS_NewObject(cx,
&MinXmlHttpRequest::js_class,
MinXmlHttpRequest::js_proto,
MinXmlHttpRequest::js_parent);
if (obj) {
JS_SetPrivate(obj, req);
out = OBJECT_TO_JSVAL(obj);
}
JS_SET_RVAL(cx, vp, out);
p =jsb_new_proxy(req, obj);
JS_AddNamedObjectRoot(cx, &p->obj, "XMLHttpRequest");
return JS_TRUE;
}