|
|
|
Lines 1027-1042
const JSPropertySpec MapObject::properti
|
Link Here
|
|---|
|
| 1027 |
const JSFunctionSpec MapObject::methods[] = { |
1027 |
const JSFunctionSpec MapObject::methods[] = { |
| 1028 |
JS_FN("get", get, 1, 0), |
1028 |
JS_FN("get", get, 1, 0), |
| 1029 |
JS_FN("has", has, 1, 0), |
1029 |
JS_FN("has", has, 1, 0), |
| 1030 |
JS_FN("set", set, 2, 0), |
1030 |
JS_FN("set", set, 2, 0), |
| 1031 |
JS_FN("delete", delete_, 1, 0), |
1031 |
JS_FN("delete", delete_, 1, 0), |
| 1032 |
JS_FN("keys", keys, 0, 0), |
1032 |
JS_FN("keys", keys, 0, 0), |
| 1033 |
JS_FN("values", values, 0, 0), |
1033 |
JS_FN("values", values, 0, 0), |
| 1034 |
JS_FN("clear", clear, 0, 0), |
1034 |
JS_FN("clear", clear, 0, 0), |
|
|
1035 |
{"forEach", {NULL, NULL}, 1, 0, "MapForEach"}, |
| 1035 |
JS_FS_END |
1036 |
JS_FS_END |
| 1036 |
}; |
1037 |
}; |
| 1037 |
|
1038 |
|
| 1038 |
static JSObject * |
1039 |
static JSObject * |
| 1039 |
InitClass(JSContext *cx, Handle<GlobalObject*> global, Class *clasp, JSProtoKey key, Native construct, |
1040 |
InitClass(JSContext *cx, Handle<GlobalObject*> global, Class *clasp, JSProtoKey key, Native construct, |
| 1040 |
const JSPropertySpec *properties, const JSFunctionSpec *methods) |
1041 |
const JSPropertySpec *properties, const JSFunctionSpec *methods) |
| 1041 |
{ |
1042 |
{ |
| 1042 |
Rooted<JSObject*> proto(cx, global->createBlankPrototype(cx, clasp)); |
1043 |
Rooted<JSObject*> proto(cx, global->createBlankPrototype(cx, clasp)); |
|
Lines 1583-1598
const JSPropertySpec SetObject::properti
|
Link Here
|
|---|
|
| 1583 |
}; |
1584 |
}; |
| 1584 |
|
1585 |
|
| 1585 |
const JSFunctionSpec SetObject::methods[] = { |
1586 |
const JSFunctionSpec SetObject::methods[] = { |
| 1586 |
JS_FN("has", has, 1, 0), |
1587 |
JS_FN("has", has, 1, 0), |
| 1587 |
JS_FN("add", add, 1, 0), |
1588 |
JS_FN("add", add, 1, 0), |
| 1588 |
JS_FN("delete", delete_, 1, 0), |
1589 |
JS_FN("delete", delete_, 1, 0), |
| 1589 |
JS_FN("entries", entries, 0, 0), |
1590 |
JS_FN("entries", entries, 0, 0), |
| 1590 |
JS_FN("clear", clear, 0, 0), |
1591 |
JS_FN("clear", clear, 0, 0), |
|
|
1592 |
{"forEach", {NULL, NULL}, 1, 0, "SetForEach"}, |
| 1591 |
JS_FS_END |
1593 |
JS_FS_END |
| 1592 |
}; |
1594 |
}; |
| 1593 |
|
1595 |
|
| 1594 |
JSObject * |
1596 |
JSObject * |
| 1595 |
SetObject::initClass(JSContext *cx, JSObject *obj) |
1597 |
SetObject::initClass(JSContext *cx, JSObject *obj) |
| 1596 |
{ |
1598 |
{ |
| 1597 |
Rooted<GlobalObject*> global(cx, &obj->as<GlobalObject>()); |
1599 |
Rooted<GlobalObject*> global(cx, &obj->as<GlobalObject>()); |
| 1598 |
RootedObject proto(cx, |
1600 |
RootedObject proto(cx, |