~oif-team/ubuntu/natty/qt4-x11/xi2.1

« back to all changes in this revision

Viewing changes to src/3rdparty/webkit/WebCore/generated/JSNamedNodeMap.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Alessandro Ghersi
  • Date: 2009-11-02 18:30:08 UTC
  • mfrom: (1.2.2 upstream)
  • mto: (15.2.5 experimental)
  • mto: This revision was merged to the branch mainline in revision 88.
  • Revision ID: james.westby@ubuntu.com-20091102183008-b6a4gcs128mvfb3m
Tags: upstream-4.6.0~beta1
ImportĀ upstreamĀ versionĀ 4.6.0~beta1

Show diffs side-by-side

added added

removed removed

Lines of Context:
19
19
*/
20
20
 
21
21
#include "config.h"
22
 
 
23
22
#include "JSNamedNodeMap.h"
24
23
 
25
 
#include <wtf/GetPtr.h>
26
 
 
27
 
#include <runtime/PropertyNameArray.h>
28
24
#include "AtomicString.h"
29
25
#include "JSNode.h"
30
26
#include "NamedNodeMap.h"
31
27
#include "Node.h"
32
 
 
33
28
#include <runtime/Error.h>
34
29
#include <runtime/JSNumberCell.h>
 
30
#include <runtime/PropertyNameArray.h>
 
31
#include <wtf/GetPtr.h>
35
32
 
36
33
using namespace JSC;
37
34
 
38
35
namespace WebCore {
39
36
 
40
 
ASSERT_CLASS_FITS_IN_CELL(JSNamedNodeMap)
 
37
ASSERT_CLASS_FITS_IN_CELL(JSNamedNodeMap);
41
38
 
42
39
/* Hash table */
43
40
 
48
45
    { 0, 0, 0, 0 }
49
46
};
50
47
 
51
 
static const HashTable JSNamedNodeMapTable =
 
48
static JSC_CONST_HASHTABLE HashTable JSNamedNodeMapTable =
52
49
#if ENABLE(PERFECT_HASH_SIZE)
53
50
    { 15, JSNamedNodeMapTableValues, 0 };
54
51
#else
62
59
    { 0, 0, 0, 0 }
63
60
};
64
61
 
65
 
static const HashTable JSNamedNodeMapConstructorTable =
 
62
static JSC_CONST_HASHTABLE HashTable JSNamedNodeMapConstructorTable =
66
63
#if ENABLE(PERFECT_HASH_SIZE)
67
64
    { 0, JSNamedNodeMapConstructorTableValues, 0 };
68
65
#else
69
66
    { 1, 0, JSNamedNodeMapConstructorTableValues, 0 };
70
67
#endif
71
68
 
72
 
class JSNamedNodeMapConstructor : public DOMObject {
 
69
class JSNamedNodeMapConstructor : public DOMConstructorObject {
73
70
public:
74
 
    JSNamedNodeMapConstructor(ExecState* exec)
75
 
        : DOMObject(JSNamedNodeMapConstructor::createStructure(exec->lexicalGlobalObject()->objectPrototype()))
 
71
    JSNamedNodeMapConstructor(ExecState* exec, JSDOMGlobalObject* globalObject)
 
72
        : DOMConstructorObject(JSNamedNodeMapConstructor::createStructure(globalObject->objectPrototype()), globalObject)
76
73
    {
77
 
        putDirect(exec->propertyNames().prototype, JSNamedNodeMapPrototype::self(exec, exec->lexicalGlobalObject()), None);
 
74
        putDirect(exec->propertyNames().prototype, JSNamedNodeMapPrototype::self(exec, globalObject), None);
78
75
    }
79
76
    virtual bool getOwnPropertySlot(ExecState*, const Identifier&, PropertySlot&);
 
77
    virtual bool getOwnPropertyDescriptor(ExecState*, const Identifier&, PropertyDescriptor&);
80
78
    virtual const ClassInfo* classInfo() const { return &s_info; }
81
79
    static const ClassInfo s_info;
82
80
 
83
 
    static PassRefPtr<Structure> createStructure(JSValuePtr proto) 
 
81
    static PassRefPtr<Structure> createStructure(JSValue proto) 
84
82
    { 
85
83
        return Structure::create(proto, TypeInfo(ObjectType, ImplementsHasInstance)); 
86
84
    }
93
91
    return getStaticValueSlot<JSNamedNodeMapConstructor, DOMObject>(exec, &JSNamedNodeMapConstructorTable, this, propertyName, slot);
94
92
}
95
93
 
 
94
bool JSNamedNodeMapConstructor::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
 
95
{
 
96
    return getStaticValueDescriptor<JSNamedNodeMapConstructor, DOMObject>(exec, &JSNamedNodeMapConstructorTable, this, propertyName, descriptor);
 
97
}
 
98
 
96
99
/* Hash table for prototype */
97
100
 
98
101
static const HashTableValue JSNamedNodeMapPrototypeTableValues[8] =
107
110
    { 0, 0, 0, 0 }
108
111
};
109
112
 
110
 
static const HashTable JSNamedNodeMapPrototypeTable =
 
113
static JSC_CONST_HASHTABLE HashTable JSNamedNodeMapPrototypeTable =
111
114
#if ENABLE(PERFECT_HASH_SIZE)
112
115
    { 15, JSNamedNodeMapPrototypeTableValues, 0 };
113
116
#else
126
129
    return getStaticFunctionSlot<JSObject>(exec, &JSNamedNodeMapPrototypeTable, this, propertyName, slot);
127
130
}
128
131
 
 
132
bool JSNamedNodeMapPrototype::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
 
133
{
 
134
    return getStaticFunctionDescriptor<JSObject>(exec, &JSNamedNodeMapPrototypeTable, this, propertyName, descriptor);
 
135
}
 
136
 
129
137
const ClassInfo JSNamedNodeMap::s_info = { "NamedNodeMap", 0, &JSNamedNodeMapTable, 0 };
130
138
 
131
 
JSNamedNodeMap::JSNamedNodeMap(PassRefPtr<Structure> structure, PassRefPtr<NamedNodeMap> impl)
132
 
    : DOMObject(structure)
 
139
JSNamedNodeMap::JSNamedNodeMap(NonNullPassRefPtr<Structure> structure, JSDOMGlobalObject* globalObject, PassRefPtr<NamedNodeMap> impl)
 
140
    : DOMObjectWithGlobalPointer(structure, globalObject)
133
141
    , m_impl(impl)
134
142
{
135
143
}
136
144
 
137
145
JSNamedNodeMap::~JSNamedNodeMap()
138
146
{
139
 
    forgetDOMObject(*Heap::heap(this)->globalData(), m_impl.get());
140
 
 
 
147
    forgetDOMObject(*Heap::heap(this)->globalData(), impl());
141
148
}
142
149
 
143
150
JSObject* JSNamedNodeMap::createPrototype(ExecState* exec, JSGlobalObject* globalObject)
147
154
 
148
155
bool JSNamedNodeMap::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
149
156
{
150
 
    JSValuePtr proto = prototype();
151
 
    if (proto->isObject() && static_cast<JSObject*>(asObject(proto))->hasProperty(exec, propertyName))
 
157
    JSValue proto = prototype();
 
158
    if (proto.isObject() && static_cast<JSObject*>(asObject(proto))->hasProperty(exec, propertyName))
152
159
        return false;
153
160
 
154
161
    const HashEntry* entry = JSNamedNodeMapTable.entry(exec, propertyName);
169
176
    return getStaticValueSlot<JSNamedNodeMap, Base>(exec, &JSNamedNodeMapTable, this, propertyName, slot);
170
177
}
171
178
 
 
179
bool JSNamedNodeMap::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
 
180
{
 
181
    JSValue proto = prototype();
 
182
    if (proto.isObject() && static_cast<JSObject*>(asObject(proto))->hasProperty(exec, propertyName))
 
183
        return false;
 
184
 
 
185
    const HashEntry* entry = JSNamedNodeMapTable.entry(exec, propertyName);
 
186
    if (entry) {
 
187
        PropertySlot slot;
 
188
        slot.setCustom(this, entry->propertyGetter());
 
189
        descriptor.setDescriptor(slot.getValue(exec, propertyName), entry->attributes());
 
190
        return true;
 
191
    }
 
192
    bool ok;
 
193
    unsigned index = propertyName.toUInt32(&ok, false);
 
194
    if (ok && index < static_cast<NamedNodeMap*>(impl())->length()) {
 
195
        PropertySlot slot;
 
196
        slot.setCustomIndex(this, index, indexGetter);
 
197
        descriptor.setDescriptor(slot.getValue(exec, propertyName), DontDelete | ReadOnly);
 
198
        return true;
 
199
    }
 
200
    if (canGetItemsForName(exec, static_cast<NamedNodeMap*>(impl()), propertyName)) {
 
201
        PropertySlot slot;
 
202
        slot.setCustom(this, nameGetter);
 
203
        descriptor.setDescriptor(slot.getValue(exec, propertyName), ReadOnly | DontDelete | DontEnum);
 
204
        return true;
 
205
    }
 
206
    return getStaticValueDescriptor<JSNamedNodeMap, Base>(exec, &JSNamedNodeMapTable, this, propertyName, descriptor);
 
207
}
 
208
 
172
209
bool JSNamedNodeMap::getOwnPropertySlot(ExecState* exec, unsigned propertyName, PropertySlot& slot)
173
210
{
174
211
    if (propertyName < static_cast<NamedNodeMap*>(impl())->length()) {
178
215
    return getOwnPropertySlot(exec, Identifier::from(exec, propertyName), slot);
179
216
}
180
217
 
181
 
JSValuePtr jsNamedNodeMapLength(ExecState* exec, const Identifier&, const PropertySlot& slot)
 
218
JSValue jsNamedNodeMapLength(ExecState* exec, const Identifier&, const PropertySlot& slot)
182
219
{
183
 
    NamedNodeMap* imp = static_cast<NamedNodeMap*>(static_cast<JSNamedNodeMap*>(asObject(slot.slotBase()))->impl());
 
220
    JSNamedNodeMap* castedThis = static_cast<JSNamedNodeMap*>(asObject(slot.slotBase()));
 
221
    UNUSED_PARAM(exec);
 
222
    NamedNodeMap* imp = static_cast<NamedNodeMap*>(castedThis->impl());
184
223
    return jsNumber(exec, imp->length());
185
224
}
186
225
 
187
 
JSValuePtr jsNamedNodeMapConstructor(ExecState* exec, const Identifier&, const PropertySlot& slot)
 
226
JSValue jsNamedNodeMapConstructor(ExecState* exec, const Identifier&, const PropertySlot& slot)
188
227
{
189
 
    return static_cast<JSNamedNodeMap*>(asObject(slot.slotBase()))->getConstructor(exec);
 
228
    JSNamedNodeMap* domObject = static_cast<JSNamedNodeMap*>(asObject(slot.slotBase()));
 
229
    return JSNamedNodeMap::getConstructor(exec, domObject->globalObject());
190
230
}
191
 
void JSNamedNodeMap::getPropertyNames(ExecState* exec, PropertyNameArray& propertyNames)
 
231
void JSNamedNodeMap::getOwnPropertyNames(ExecState* exec, PropertyNameArray& propertyNames)
192
232
{
193
233
    for (unsigned i = 0; i < static_cast<NamedNodeMap*>(impl())->length(); ++i)
194
234
        propertyNames.add(Identifier::from(exec, i));
195
 
     Base::getPropertyNames(exec, propertyNames);
196
 
}
197
 
 
198
 
JSValuePtr JSNamedNodeMap::getConstructor(ExecState* exec)
199
 
{
200
 
    return getDOMConstructor<JSNamedNodeMapConstructor>(exec);
201
 
}
202
 
 
203
 
JSValuePtr jsNamedNodeMapPrototypeFunctionGetNamedItem(ExecState* exec, JSObject*, JSValuePtr thisValue, const ArgList& args)
204
 
{
205
 
    if (!thisValue->isObject(&JSNamedNodeMap::s_info))
206
 
        return throwError(exec, TypeError);
207
 
    JSNamedNodeMap* castedThisObj = static_cast<JSNamedNodeMap*>(asObject(thisValue));
208
 
    NamedNodeMap* imp = static_cast<NamedNodeMap*>(castedThisObj->impl());
209
 
    const UString& name = args.at(exec, 0)->toString(exec);
210
 
 
211
 
 
212
 
    JSC::JSValuePtr result = toJS(exec, WTF::getPtr(imp->getNamedItem(name)));
213
 
    return result;
214
 
}
215
 
 
216
 
JSValuePtr jsNamedNodeMapPrototypeFunctionSetNamedItem(ExecState* exec, JSObject*, JSValuePtr thisValue, const ArgList& args)
217
 
{
218
 
    if (!thisValue->isObject(&JSNamedNodeMap::s_info))
219
 
        return throwError(exec, TypeError);
220
 
    JSNamedNodeMap* castedThisObj = static_cast<JSNamedNodeMap*>(asObject(thisValue));
221
 
    NamedNodeMap* imp = static_cast<NamedNodeMap*>(castedThisObj->impl());
222
 
    ExceptionCode ec = 0;
223
 
    Node* node = toNode(args.at(exec, 0));
224
 
 
225
 
 
226
 
    JSC::JSValuePtr result = toJS(exec, WTF::getPtr(imp->setNamedItem(node, ec)));
227
 
    setDOMException(exec, ec);
228
 
    return result;
229
 
}
230
 
 
231
 
JSValuePtr jsNamedNodeMapPrototypeFunctionRemoveNamedItem(ExecState* exec, JSObject*, JSValuePtr thisValue, const ArgList& args)
232
 
{
233
 
    if (!thisValue->isObject(&JSNamedNodeMap::s_info))
234
 
        return throwError(exec, TypeError);
235
 
    JSNamedNodeMap* castedThisObj = static_cast<JSNamedNodeMap*>(asObject(thisValue));
236
 
    NamedNodeMap* imp = static_cast<NamedNodeMap*>(castedThisObj->impl());
237
 
    ExceptionCode ec = 0;
238
 
    const UString& name = args.at(exec, 0)->toString(exec);
239
 
 
240
 
 
241
 
    JSC::JSValuePtr result = toJS(exec, WTF::getPtr(imp->removeNamedItem(name, ec)));
242
 
    setDOMException(exec, ec);
243
 
    return result;
244
 
}
245
 
 
246
 
JSValuePtr jsNamedNodeMapPrototypeFunctionItem(ExecState* exec, JSObject*, JSValuePtr thisValue, const ArgList& args)
247
 
{
248
 
    if (!thisValue->isObject(&JSNamedNodeMap::s_info))
249
 
        return throwError(exec, TypeError);
250
 
    JSNamedNodeMap* castedThisObj = static_cast<JSNamedNodeMap*>(asObject(thisValue));
251
 
    NamedNodeMap* imp = static_cast<NamedNodeMap*>(castedThisObj->impl());
252
 
    unsigned index = args.at(exec, 0)->toInt32(exec);
253
 
 
254
 
 
255
 
    JSC::JSValuePtr result = toJS(exec, WTF::getPtr(imp->item(index)));
256
 
    return result;
257
 
}
258
 
 
259
 
JSValuePtr jsNamedNodeMapPrototypeFunctionGetNamedItemNS(ExecState* exec, JSObject*, JSValuePtr thisValue, const ArgList& args)
260
 
{
261
 
    if (!thisValue->isObject(&JSNamedNodeMap::s_info))
262
 
        return throwError(exec, TypeError);
263
 
    JSNamedNodeMap* castedThisObj = static_cast<JSNamedNodeMap*>(asObject(thisValue));
264
 
    NamedNodeMap* imp = static_cast<NamedNodeMap*>(castedThisObj->impl());
265
 
    const UString& namespaceURI = valueToStringWithNullCheck(exec, args.at(exec, 0));
266
 
    const UString& localName = args.at(exec, 1)->toString(exec);
267
 
 
268
 
 
269
 
    JSC::JSValuePtr result = toJS(exec, WTF::getPtr(imp->getNamedItemNS(namespaceURI, localName)));
270
 
    return result;
271
 
}
272
 
 
273
 
JSValuePtr jsNamedNodeMapPrototypeFunctionSetNamedItemNS(ExecState* exec, JSObject*, JSValuePtr thisValue, const ArgList& args)
274
 
{
275
 
    if (!thisValue->isObject(&JSNamedNodeMap::s_info))
276
 
        return throwError(exec, TypeError);
277
 
    JSNamedNodeMap* castedThisObj = static_cast<JSNamedNodeMap*>(asObject(thisValue));
278
 
    NamedNodeMap* imp = static_cast<NamedNodeMap*>(castedThisObj->impl());
279
 
    ExceptionCode ec = 0;
280
 
    Node* node = toNode(args.at(exec, 0));
281
 
 
282
 
 
283
 
    JSC::JSValuePtr result = toJS(exec, WTF::getPtr(imp->setNamedItemNS(node, ec)));
284
 
    setDOMException(exec, ec);
285
 
    return result;
286
 
}
287
 
 
288
 
JSValuePtr jsNamedNodeMapPrototypeFunctionRemoveNamedItemNS(ExecState* exec, JSObject*, JSValuePtr thisValue, const ArgList& args)
289
 
{
290
 
    if (!thisValue->isObject(&JSNamedNodeMap::s_info))
291
 
        return throwError(exec, TypeError);
292
 
    JSNamedNodeMap* castedThisObj = static_cast<JSNamedNodeMap*>(asObject(thisValue));
293
 
    NamedNodeMap* imp = static_cast<NamedNodeMap*>(castedThisObj->impl());
294
 
    ExceptionCode ec = 0;
295
 
    const UString& namespaceURI = valueToStringWithNullCheck(exec, args.at(exec, 0));
296
 
    const UString& localName = args.at(exec, 1)->toString(exec);
297
 
 
298
 
 
299
 
    JSC::JSValuePtr result = toJS(exec, WTF::getPtr(imp->removeNamedItemNS(namespaceURI, localName, ec)));
300
 
    setDOMException(exec, ec);
301
 
    return result;
302
 
}
303
 
 
304
 
 
305
 
JSValuePtr JSNamedNodeMap::indexGetter(ExecState* exec, const Identifier& propertyName, const PropertySlot& slot)
 
235
     Base::getOwnPropertyNames(exec, propertyNames);
 
236
}
 
237
 
 
238
JSValue JSNamedNodeMap::getConstructor(ExecState* exec, JSGlobalObject* globalObject)
 
239
{
 
240
    return getDOMConstructor<JSNamedNodeMapConstructor>(exec, static_cast<JSDOMGlobalObject*>(globalObject));
 
241
}
 
242
 
 
243
JSValue JSC_HOST_CALL jsNamedNodeMapPrototypeFunctionGetNamedItem(ExecState* exec, JSObject*, JSValue thisValue, const ArgList& args)
 
244
{
 
245
    UNUSED_PARAM(args);
 
246
    if (!thisValue.inherits(&JSNamedNodeMap::s_info))
 
247
        return throwError(exec, TypeError);
 
248
    JSNamedNodeMap* castedThisObj = static_cast<JSNamedNodeMap*>(asObject(thisValue));
 
249
    NamedNodeMap* imp = static_cast<NamedNodeMap*>(castedThisObj->impl());
 
250
    const UString& name = args.at(0).toString(exec);
 
251
 
 
252
 
 
253
    JSC::JSValue result = toJS(exec, castedThisObj->globalObject(), WTF::getPtr(imp->getNamedItem(name)));
 
254
    return result;
 
255
}
 
256
 
 
257
JSValue JSC_HOST_CALL jsNamedNodeMapPrototypeFunctionSetNamedItem(ExecState* exec, JSObject*, JSValue thisValue, const ArgList& args)
 
258
{
 
259
    UNUSED_PARAM(args);
 
260
    if (!thisValue.inherits(&JSNamedNodeMap::s_info))
 
261
        return throwError(exec, TypeError);
 
262
    JSNamedNodeMap* castedThisObj = static_cast<JSNamedNodeMap*>(asObject(thisValue));
 
263
    NamedNodeMap* imp = static_cast<NamedNodeMap*>(castedThisObj->impl());
 
264
    ExceptionCode ec = 0;
 
265
    Node* node = toNode(args.at(0));
 
266
 
 
267
 
 
268
    JSC::JSValue result = toJS(exec, castedThisObj->globalObject(), WTF::getPtr(imp->setNamedItem(node, ec)));
 
269
    setDOMException(exec, ec);
 
270
    return result;
 
271
}
 
272
 
 
273
JSValue JSC_HOST_CALL jsNamedNodeMapPrototypeFunctionRemoveNamedItem(ExecState* exec, JSObject*, JSValue thisValue, const ArgList& args)
 
274
{
 
275
    UNUSED_PARAM(args);
 
276
    if (!thisValue.inherits(&JSNamedNodeMap::s_info))
 
277
        return throwError(exec, TypeError);
 
278
    JSNamedNodeMap* castedThisObj = static_cast<JSNamedNodeMap*>(asObject(thisValue));
 
279
    NamedNodeMap* imp = static_cast<NamedNodeMap*>(castedThisObj->impl());
 
280
    ExceptionCode ec = 0;
 
281
    const UString& name = args.at(0).toString(exec);
 
282
 
 
283
 
 
284
    JSC::JSValue result = toJS(exec, castedThisObj->globalObject(), WTF::getPtr(imp->removeNamedItem(name, ec)));
 
285
    setDOMException(exec, ec);
 
286
    return result;
 
287
}
 
288
 
 
289
JSValue JSC_HOST_CALL jsNamedNodeMapPrototypeFunctionItem(ExecState* exec, JSObject*, JSValue thisValue, const ArgList& args)
 
290
{
 
291
    UNUSED_PARAM(args);
 
292
    if (!thisValue.inherits(&JSNamedNodeMap::s_info))
 
293
        return throwError(exec, TypeError);
 
294
    JSNamedNodeMap* castedThisObj = static_cast<JSNamedNodeMap*>(asObject(thisValue));
 
295
    NamedNodeMap* imp = static_cast<NamedNodeMap*>(castedThisObj->impl());
 
296
    unsigned index = args.at(0).toInt32(exec);
 
297
 
 
298
 
 
299
    JSC::JSValue result = toJS(exec, castedThisObj->globalObject(), WTF::getPtr(imp->item(index)));
 
300
    return result;
 
301
}
 
302
 
 
303
JSValue JSC_HOST_CALL jsNamedNodeMapPrototypeFunctionGetNamedItemNS(ExecState* exec, JSObject*, JSValue thisValue, const ArgList& args)
 
304
{
 
305
    UNUSED_PARAM(args);
 
306
    if (!thisValue.inherits(&JSNamedNodeMap::s_info))
 
307
        return throwError(exec, TypeError);
 
308
    JSNamedNodeMap* castedThisObj = static_cast<JSNamedNodeMap*>(asObject(thisValue));
 
309
    NamedNodeMap* imp = static_cast<NamedNodeMap*>(castedThisObj->impl());
 
310
    const UString& namespaceURI = valueToStringWithNullCheck(exec, args.at(0));
 
311
    const UString& localName = args.at(1).toString(exec);
 
312
 
 
313
 
 
314
    JSC::JSValue result = toJS(exec, castedThisObj->globalObject(), WTF::getPtr(imp->getNamedItemNS(namespaceURI, localName)));
 
315
    return result;
 
316
}
 
317
 
 
318
JSValue JSC_HOST_CALL jsNamedNodeMapPrototypeFunctionSetNamedItemNS(ExecState* exec, JSObject*, JSValue thisValue, const ArgList& args)
 
319
{
 
320
    UNUSED_PARAM(args);
 
321
    if (!thisValue.inherits(&JSNamedNodeMap::s_info))
 
322
        return throwError(exec, TypeError);
 
323
    JSNamedNodeMap* castedThisObj = static_cast<JSNamedNodeMap*>(asObject(thisValue));
 
324
    NamedNodeMap* imp = static_cast<NamedNodeMap*>(castedThisObj->impl());
 
325
    ExceptionCode ec = 0;
 
326
    Node* node = toNode(args.at(0));
 
327
 
 
328
 
 
329
    JSC::JSValue result = toJS(exec, castedThisObj->globalObject(), WTF::getPtr(imp->setNamedItemNS(node, ec)));
 
330
    setDOMException(exec, ec);
 
331
    return result;
 
332
}
 
333
 
 
334
JSValue JSC_HOST_CALL jsNamedNodeMapPrototypeFunctionRemoveNamedItemNS(ExecState* exec, JSObject*, JSValue thisValue, const ArgList& args)
 
335
{
 
336
    UNUSED_PARAM(args);
 
337
    if (!thisValue.inherits(&JSNamedNodeMap::s_info))
 
338
        return throwError(exec, TypeError);
 
339
    JSNamedNodeMap* castedThisObj = static_cast<JSNamedNodeMap*>(asObject(thisValue));
 
340
    NamedNodeMap* imp = static_cast<NamedNodeMap*>(castedThisObj->impl());
 
341
    ExceptionCode ec = 0;
 
342
    const UString& namespaceURI = valueToStringWithNullCheck(exec, args.at(0));
 
343
    const UString& localName = args.at(1).toString(exec);
 
344
 
 
345
 
 
346
    JSC::JSValue result = toJS(exec, castedThisObj->globalObject(), WTF::getPtr(imp->removeNamedItemNS(namespaceURI, localName, ec)));
 
347
    setDOMException(exec, ec);
 
348
    return result;
 
349
}
 
350
 
 
351
 
 
352
JSValue JSNamedNodeMap::indexGetter(ExecState* exec, const Identifier&, const PropertySlot& slot)
306
353
{
307
354
    JSNamedNodeMap* thisObj = static_cast<JSNamedNodeMap*>(asObject(slot.slotBase()));
308
 
    return toJS(exec, static_cast<NamedNodeMap*>(thisObj->impl())->item(slot.index()));
309
 
}
310
 
JSC::JSValuePtr toJS(JSC::ExecState* exec, NamedNodeMap* object)
311
 
{
312
 
    return getDOMObjectWrapper<JSNamedNodeMap>(exec, object);
313
 
}
314
 
NamedNodeMap* toNamedNodeMap(JSC::JSValuePtr value)
315
 
{
316
 
    return value->isObject(&JSNamedNodeMap::s_info) ? static_cast<JSNamedNodeMap*>(asObject(value))->impl() : 0;
 
355
    return toJS(exec, thisObj->globalObject(), static_cast<NamedNodeMap*>(thisObj->impl())->item(slot.index()));
 
356
}
 
357
JSC::JSValue toJS(JSC::ExecState* exec, JSDOMGlobalObject* globalObject, NamedNodeMap* object)
 
358
{
 
359
    return getDOMObjectWrapper<JSNamedNodeMap>(exec, globalObject, object);
 
360
}
 
361
NamedNodeMap* toNamedNodeMap(JSC::JSValue value)
 
362
{
 
363
    return value.inherits(&JSNamedNodeMap::s_info) ? static_cast<JSNamedNodeMap*>(asObject(value))->impl() : 0;
317
364
}
318
365
 
319
366
}