Changeset 23479 in webkit for trunk/JavaScriptCore/bindings/runtime.cpp
- Timestamp:
- Jun 12, 2007, 9:25:28 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/bindings/runtime.cpp
r23467 r23479 44 44 45 45 namespace KJS { namespace Bindings { 46 47 void MethodList::addMethod(Method *aMethod)48 {49 Method **_newMethods = new Method *[_length + 1];50 if (_length > 0) {51 memcpy(_newMethods, _methods, sizeof(Method *) * _length);52 delete [] _methods;53 }54 _methods = _newMethods;55 _methods[_length++] = aMethod;56 }57 58 unsigned int MethodList::length() const59 {60 return _length;61 }62 63 Method *MethodList::methodAt(unsigned int index) const64 {65 assert(index < _length);66 return _methods[index];67 }68 69 MethodList::~MethodList()70 {71 delete [] _methods;72 }73 74 MethodList::MethodList(const MethodList &other)75 {76 _length = other._length;77 _methods = new Method *[_length];78 if (_length > 0)79 memcpy (_methods, other._methods, sizeof(Method *) * _length);80 }81 82 MethodList &MethodList::operator=(const MethodList &other)83 {84 if (this == &other)85 return *this;86 87 delete [] _methods;88 89 _length = other._length;90 _methods = new Method *[_length];91 if (_length > 0)92 memcpy(_methods, other._methods, sizeof(Method *) * _length);93 94 return *this;95 }96 46 97 47 Array::Array(PassRefPtr<RootObject> rootObject)
Note:
See TracChangeset
for help on using the changeset viewer.