1 typedef union jsval_layout {
2 unsigned long int asBits;
4 static jsval_layout STRING_TO_JSVAL_IMPL(void * str) {
6 typedef __attribute__ ((aligned(8))) unsigned long int jsval;
7 typedef struct JSLinearString JSLinearString;
14 public:void setString() {
15 data = STRING_TO_JSVAL_IMPL(0);
17 } __attribute__ ((aligned(8)));
18 static Value StringValue() {
23 static const jsval & Jsvalify(const Value & v) {
24 return (const jsval &)v;
26 static Value *Valueify(jsval * v) {
38 Class * getClass() const {
39 } inline JSLinearString *getQNameLocalName() const;
42 static Value IdToValue(long int id) {
45 } static jsval IdToJsval(long int id) {
46 return Jsvalify(IdToValue(id));
50 inline int js_IdIsIndex(long int id, unsigned int * indexp)
57 AutoGCRooter * autoGCRooters;
61 public:AutoGCRooter(JSContext * cx,
62 long int tag):down(cx->autoGCRooters), tag(tag),
64 cx->autoGCRooters = this;
65 } protected:AutoGCRooter * const down;
67 JSContext *const context;
69 class AutoArrayRooter:private AutoGCRooter {
70 public:AutoArrayRooter(JSContext * cx, long unsigned int len,
71 Value * vec):AutoGCRooter(cx, len),
77 typedef enum JSXMLClass {
84 unsigned int xml_class;
86 Class js_AttributeNameClass;
87 static JSObject *NewXMLAttributeName(JSLinearString * localName)
91 static void PutProperty(JSContext * cx,
97 roots[1] = IdToJsval(id);
99 AutoArrayRooter tvr(cx, 0, Valueify(roots));
100 NewXMLAttributeName(nameobj->
101 getQNameLocalName());
104 void xml_defineProperty(
109 jsval tmp = Jsvalify(*v);
110 PutProperty(cx, id, &tmp);