2
This file is part of the WebKit open source project.
3
This file has been generated by generate-bindings.pl. DO NOT MODIFY!
5
This library is free software; you can redistribute it and/or
6
modify it under the terms of the GNU Library General Public
7
License as published by the Free Software Foundation; either
8
version 2 of the License, or (at your option) any later version.
10
This library is distributed in the hope that it will be useful,
11
but WITHOUT ANY WARRANTY; without even the implied warranty of
12
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13
Library General Public License for more details.
15
You should have received a copy of the GNU Library General Public License
16
along with this library; see the file COPYING.LIB. If not, write to
17
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18
Boston, MA 02110-1301, USA.
25
#include "JSCanvasUnsignedShortArray.h"
27
#include "CanvasUnsignedShortArray.h"
28
#include <runtime/PropertyNameArray.h>
29
#include <wtf/GetPtr.h>
35
ASSERT_CLASS_FITS_IN_CELL(JSCanvasUnsignedShortArray);
37
/* Hash table for prototype */
39
static const HashTableValue JSCanvasUnsignedShortArrayPrototypeTableValues[1] =
44
static JSC_CONST_HASHTABLE HashTable JSCanvasUnsignedShortArrayPrototypeTable =
45
#if ENABLE(PERFECT_HASH_SIZE)
46
{ 0, JSCanvasUnsignedShortArrayPrototypeTableValues, 0 };
48
{ 1, 0, JSCanvasUnsignedShortArrayPrototypeTableValues, 0 };
51
const ClassInfo JSCanvasUnsignedShortArrayPrototype::s_info = { "CanvasUnsignedShortArrayPrototype", 0, &JSCanvasUnsignedShortArrayPrototypeTable, 0 };
53
JSObject* JSCanvasUnsignedShortArrayPrototype::self(ExecState* exec, JSGlobalObject* globalObject)
55
return getDOMPrototype<JSCanvasUnsignedShortArray>(exec, globalObject);
58
const ClassInfo JSCanvasUnsignedShortArray::s_info = { "CanvasUnsignedShortArray", &JSCanvasArray::s_info, 0, 0 };
60
JSCanvasUnsignedShortArray::JSCanvasUnsignedShortArray(NonNullPassRefPtr<Structure> structure, JSDOMGlobalObject* globalObject, PassRefPtr<CanvasUnsignedShortArray> impl)
61
: JSCanvasArray(structure, globalObject, impl)
65
JSObject* JSCanvasUnsignedShortArray::createPrototype(ExecState* exec, JSGlobalObject* globalObject)
67
return new (exec) JSCanvasUnsignedShortArrayPrototype(JSCanvasUnsignedShortArrayPrototype::createStructure(JSCanvasArrayPrototype::self(exec, globalObject)));
70
bool JSCanvasUnsignedShortArray::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
73
unsigned index = propertyName.toUInt32(&ok, false);
74
if (ok && index < static_cast<CanvasUnsignedShortArray*>(impl())->length()) {
75
slot.setValue(getByIndex(exec, index));
78
return Base::getOwnPropertySlot(exec, propertyName, slot);
81
bool JSCanvasUnsignedShortArray::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
84
unsigned index = propertyName.toUInt32(&ok, false);
85
if (ok && index < static_cast<CanvasUnsignedShortArray*>(impl())->length()) {
86
descriptor.setDescriptor(getByIndex(exec, index), DontDelete);
89
return Base::getOwnPropertyDescriptor(exec, propertyName, descriptor);
92
bool JSCanvasUnsignedShortArray::getOwnPropertySlot(ExecState* exec, unsigned propertyName, PropertySlot& slot)
94
if (propertyName < static_cast<CanvasUnsignedShortArray*>(impl())->length()) {
95
slot.setValue(getByIndex(exec, propertyName));
98
return getOwnPropertySlot(exec, Identifier::from(exec, propertyName), slot);
101
void JSCanvasUnsignedShortArray::put(ExecState* exec, const Identifier& propertyName, JSValue value, PutPropertySlot& slot)
104
unsigned index = propertyName.toUInt32(&ok, false);
106
indexSetter(exec, index, value);
109
Base::put(exec, propertyName, value, slot);
112
void JSCanvasUnsignedShortArray::put(ExecState* exec, unsigned propertyName, JSValue value)
114
indexSetter(exec, propertyName, value);
118
void JSCanvasUnsignedShortArray::getOwnPropertyNames(ExecState* exec, PropertyNameArray& propertyNames)
120
for (unsigned i = 0; i < static_cast<CanvasUnsignedShortArray*>(impl())->length(); ++i)
121
propertyNames.add(Identifier::from(exec, i));
122
Base::getOwnPropertyNames(exec, propertyNames);
126
JSValue JSCanvasUnsignedShortArray::getByIndex(ExecState* exec, unsigned index)
128
return jsNumber(exec, static_cast<CanvasUnsignedShortArray*>(impl())->item(index));
130
CanvasUnsignedShortArray* toCanvasUnsignedShortArray(JSC::JSValue value)
132
return value.inherits(&JSCanvasUnsignedShortArray::s_info) ? static_cast<JSCanvasUnsignedShortArray*>(asObject(value))->impl() : 0;
137
#endif // ENABLE(3D_CANVAS)