|
|
|
Lines 1037-1052
const JSPropertySpec MapObject::properti
|
Link Here
|
|---|
|
| 1037 |
const JSFunctionSpec MapObject::methods[] = { |
1037 |
const JSFunctionSpec MapObject::methods[] = { |
| 1038 |
JS_FN("get", get, 1, 0), |
1038 |
JS_FN("get", get, 1, 0), |
| 1039 |
JS_FN("has", has, 1, 0), |
1039 |
JS_FN("has", has, 1, 0), |
| 1040 |
JS_FN("set", set, 2, 0), |
1040 |
JS_FN("set", set, 2, 0), |
| 1041 |
JS_FN("delete", delete_, 1, 0), |
1041 |
JS_FN("delete", delete_, 1, 0), |
| 1042 |
JS_FN("keys", keys, 0, 0), |
1042 |
JS_FN("keys", keys, 0, 0), |
| 1043 |
JS_FN("values", values, 0, 0), |
1043 |
JS_FN("values", values, 0, 0), |
| 1044 |
JS_FN("clear", clear, 0, 0), |
1044 |
JS_FN("clear", clear, 0, 0), |
|
|
1045 |
{"forEach", {NULL, NULL}, 1, 0, "MapForEach"}, |
| 1045 |
JS_FS_END |
1046 |
JS_FS_END |
| 1046 |
}; |
1047 |
}; |
| 1047 |
|
1048 |
|
| 1048 |
static JSObject * |
1049 |
static JSObject * |
| 1049 |
InitClass(JSContext *cx, Handle<GlobalObject*> global, Class *clasp, JSProtoKey key, Native construct, |
1050 |
InitClass(JSContext *cx, Handle<GlobalObject*> global, Class *clasp, JSProtoKey key, Native construct, |
| 1050 |
const JSPropertySpec *properties, const JSFunctionSpec *methods) |
1051 |
const JSPropertySpec *properties, const JSFunctionSpec *methods) |
| 1051 |
{ |
1052 |
{ |
| 1052 |
Rooted<JSObject*> proto(cx, global->createBlankPrototype(cx, clasp)); |
1053 |
Rooted<JSObject*> proto(cx, global->createBlankPrototype(cx, clasp)); |
|
Lines 1615-1630
const JSPropertySpec SetObject::properti
|
Link Here
|
|---|
|
| 1615 |
}; |
1616 |
}; |
| 1616 |
|
1617 |
|
| 1617 |
const JSFunctionSpec SetObject::methods[] = { |
1618 |
const JSFunctionSpec SetObject::methods[] = { |
| 1618 |
JS_FN("has", has, 1, 0), |
1619 |
JS_FN("has", has, 1, 0), |
| 1619 |
JS_FN("add", add, 1, 0), |
1620 |
JS_FN("add", add, 1, 0), |
| 1620 |
JS_FN("delete", delete_, 1, 0), |
1621 |
JS_FN("delete", delete_, 1, 0), |
| 1621 |
JS_FN("entries", entries, 0, 0), |
1622 |
JS_FN("entries", entries, 0, 0), |
| 1622 |
JS_FN("clear", clear, 0, 0), |
1623 |
JS_FN("clear", clear, 0, 0), |
|
|
1624 |
{"forEach", {NULL, NULL}, 1, 0, "SetForEach"}, |
| 1623 |
JS_FS_END |
1625 |
JS_FS_END |
| 1624 |
}; |
1626 |
}; |
| 1625 |
|
1627 |
|
| 1626 |
JSObject * |
1628 |
JSObject * |
| 1627 |
SetObject::initClass(JSContext *cx, JSObject *obj) |
1629 |
SetObject::initClass(JSContext *cx, JSObject *obj) |
| 1628 |
{ |
1630 |
{ |
| 1629 |
Rooted<GlobalObject*> global(cx, &obj->asGlobal()); |
1631 |
Rooted<GlobalObject*> global(cx, &obj->asGlobal()); |
| 1630 |
RootedObject proto(cx, |
1632 |
RootedObject proto(cx, |