1 typedef long unsigned int size_t;
2 typedef long int ptrdiff_t;
3 typedef unsigned int uint32_t;
4 typedef unsigned long int uint64_t;
5 typedef uint32_t JSUint32;
6 typedef uint64_t JSUint64;
9 typedef JSUint64 uint64;
10 typedef JSUint32 uint32;
12 typedef struct JSString JSString;
13 typedef union jsval_layout {
16 static jsval_layout STRING_TO_JSVAL_IMPL(JSString * str) {
17 } typedef __attribute__ ((aligned(8))) uint64 jsval;
18 typedef ptrdiff_t jsid;
19 typedef JSUint32 jsuint;
23 static JSBool JSID_IS_STRING(jsid iden) {
25 static JSString *JSID_TO_STRING(jsid iden) {
27 typedef struct JSLinearString JSLinearString;
33 void setString(JSString * str) {
34 data = STRING_TO_JSVAL_IMPL(str);
38 __attribute__ ((aligned(8)));
39 static Value StringValue(JSString * str) {
44 static inline const jsval & Jsvalify(const Value & v) {
45 return (const jsval &)v;
47 static inline Value *Valueify(jsval * v) {
55 }} struct JSObject:js::gc::Cell {
56 js::Class * getClass() const {
57 } inline JSLinearString *getNamePrefix() const;
58 inline JSLinearString *getNameURI() const;
59 inline JSLinearString *getQNameLocalName() const;
62 static Value IdToValue(jsid id) {
63 if (JSID_IS_STRING(id))
64 return StringValue(JSID_TO_STRING(id));
65 } static jsval IdToJsval(jsid id) {
66 return Jsvalify(IdToValue(id));
70 inline JSBool js_IdIsIndex(jsid id, jsuint * indexp)
77 js::AutoGCRooter * autoGCRooters;
81 public:AutoGCRooter(JSContext * cx,
82 ptrdiff_t tag):down(cx->autoGCRooters), tag(tag),
84 cx->autoGCRooters = this;
85 } protected:AutoGCRooter * const down;
87 JSContext *const context;
89 class AutoArrayRooter:private AutoGCRooter {
90 public:AutoArrayRooter(JSContext * cx, size_t len,
91 Value * vec):AutoGCRooter(cx, len),
97 typedef enum JSXMLClass {
100 struct JSXML:js::gc::Cell {
104 Class js_AttributeNameClass;
105 static JSObject *NewXMLAttributeName(
106 JSLinearString * localName)
110 static JSBool PutProperty(JSContext * cx, JSObject * obj, jsid id,
111 JSBool strict, jsval * vp)
114 OBJ_ROOT, ID_ROOT, VAL_ROOT
116 JSXML *xml; JSXML *vxml; JSXML *rxml; JSXML *kid; JSXML *attr; JSXML *parent; JSXML *copy; JSXML *kid2; JSXML *match;
117 JSObject *vobj; JSObject *nameobj; JSObject *attrobj; JSObject *parentobj; JSObject *kidobj; JSObject *copyobj;
118 uint32 index; uint32 i; uint32 j; uint32 k; uint32 n; uint32 q; uint32 matchIndex;
120 roots[ID_ROOT] = IdToJsval(id);
121 roots[VAL_ROOT] = *vp;
122 AutoArrayRooter tvr(cx, 0,
124 if (js_IdIsIndex(id, &index)) {
125 if (kid->xml_class == JSXML_CLASS_ATTRIBUTE) {
126 if (nameobj->getClass() != &js_AttributeNameClass) {
130 getQNameLocalName());
136 JSBool xml_defineProperty(JSContext * cx, JSObject * obj, jsid id,
139 jsval tmp = Jsvalify(*v);
142 obj, id, false, &tmp);