]> git.wh0rd.org - ICEs.git/blame - 571482/jsxml.ii.7
more
[ICEs.git] / 571482 / jsxml.ii.7
CommitLineData
bd3239d2
MF
1 typedef union jsval_layout {
2 unsigned long int asBits;
3 } jsval_layout;
4 static jsval_layout STRING_TO_JSVAL_IMPL(void * str) {
5 }
6typedef __attribute__ ((aligned(8))) unsigned long int jsval;
7 typedef struct JSLinearString JSLinearString;
8
9namespace js {}
10using namespace js;
11
12namespace js {
13 class Value {
14 public:void setString() {
15 data = STRING_TO_JSVAL_IMPL(0);
16 } jsval_layout data;
17 } __attribute__ ((aligned(8)));
18 static Value StringValue() {
19 Value v;
20 v.setString();
21 return v;
22 }
23 static const jsval & Jsvalify(const Value & v) {
24 return (const jsval &)v;
25 }
26 static Value *Valueify(jsval * v) {
27 return (Value *) v;
28 }
29 struct Class {
30 };
31 namespace gc {
32 struct Cell {
33 };
34}} struct
35JSObject:js::gc::
36Cell
37{
38Class * getClass() const {
39 } inline JSLinearString *getQNameLocalName() const;
40};
41namespace js {
42 static Value IdToValue(long int id) {
43 if (id)
44 return StringValue();
45 } static jsval IdToJsval(long int id) {
46 return Jsvalify(IdToValue(id));
47 }
48}
49
50inline int js_IdIsIndex(long int id, unsigned int * indexp)
51{
52}
53
54namespace js {
55 class AutoGCRooter;
56} struct JSContext {
57AutoGCRooter * autoGCRooters;
58};
59namespace js {
60 class AutoGCRooter {
61 public:AutoGCRooter(JSContext * cx,
62 long int tag):down(cx->autoGCRooters), tag(tag),
63 context(cx) {
64 cx->autoGCRooters = this;
65 } protected:AutoGCRooter * const down;
66 long int tag;
67 JSContext *const context;
68 };
69 class AutoArrayRooter:private AutoGCRooter {
70 public:AutoArrayRooter(JSContext * cx, long unsigned int len,
71 Value * vec):AutoGCRooter(cx, len),
72 array(vec) {
73 } Value *array;
74 private:};
75}
76
77typedef enum JSXMLClass {
78 JSXML_CLASS_ATTRIBUTE
79} JSXMLElemVar;
80struct
81JSXML:js::
82gc::
83Cell {
84 unsigned int xml_class;
85};
86Class js_AttributeNameClass;
87static JSObject *NewXMLAttributeName(JSLinearString * localName)
88{
89}
90
91static void PutProperty(JSContext * cx,
92long int id,
93jsval * vp)
94{
95 JSObject *nameobj;
96 jsval roots[3];
97 roots[1] = IdToJsval(id);
98 roots[2] = *vp;
99 AutoArrayRooter tvr(cx, 0, Valueify(roots));
100 NewXMLAttributeName(nameobj->
101 getQNameLocalName());
102}
103
104void xml_defineProperty(
105JSContext * cx,
106long int id,
107 const Value * v)
108{
109 jsval tmp = Jsvalify(*v);
110PutProperty(cx, id, &tmp);
111}