Changeset 2783 in webkit for trunk/JavaScriptCore/kjs/object.cpp
- Timestamp:
- Nov 20, 2002, 1:12:14 PM (23 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/kjs/object.cpp
r2772 r2783 59 59 } 60 60 61 ObjectImp::ObjectImp(ObjectImp *proto) 62 : _proto(proto), _internalValue(0L), _scope(true) 63 { 64 //fprintf(stderr,"ObjectImp::ObjectImp %p\n",(void*)this); 65 } 66 61 67 ObjectImp::ObjectImp() : 62 68 _scope(true) … … 153 159 } 154 160 155 // This get method only looks at the property map.156 // A bit like hasProperty(recursive=false), this doesn't go to the prototype.157 // This is used e.g. by lookupOrCreateFunction (to cache a function, we don't want158 // to look up in the prototype, it might already exist there)159 ValueImp* ObjectImp::getDirect(const Identifier& propertyName) const160 {161 return _prop.get(propertyName);162 }163 164 161 // ECMA 8.6.2.2 165 162 void ObjectImp::put(ExecState *exec, const Identifier &propertyName, … … 168 165 assert(!value.isNull()); 169 166 assert(value.type() != ListType); 167 168 // non-standard netscape extension 169 if (propertyName == specialPrototypePropertyName) { 170 setPrototype(value); 171 return; 172 } 170 173 171 174 /* TODO: check for write permissions directly w/o this call */ … … 178 181 fprintf( stderr, "WARNING: canPut %s said NO\n", propertyName.ascii() ); 179 182 #endif 180 return;181 }182 183 // non-standard netscape extension184 if (propertyName == specialPrototypePropertyName) {185 setPrototype(value);186 183 return; 187 184 } … … 395 392 for (int i = 0; i < size; ++i, ++e) { 396 393 if ( e->s && !(e->attr & DontEnum) ) 397 list.append(Reference( Object(this), e->s)); /// ######### check for duplicates with the propertymap394 list.append(Reference(this, e->s)); /// ######### check for duplicates with the propertymap 398 395 } 399 396 } … … 412 409 { 413 410 _internalValue = v.imp(); 411 } 412 413 void ObjectImp::setInternalValue(ValueImp *v) 414 { 415 v->setGcAllowed(); 416 _internalValue = v; 414 417 } 415 418 … … 445 448 } 446 449 450 void ObjectImp::putDirect(const Identifier &propertyName, ValueImp *value, int attr) 451 { 452 value->setGcAllowed(); 453 _prop.put(propertyName, value, attr); 454 } 455 456 void ObjectImp::putDirect(const Identifier &propertyName, int value, int attr) 457 { 458 _prop.put(propertyName, NumberImp::create(value), attr); 459 } 447 460 448 461 // ------------------------------ Error ----------------------------------------
Note:
See TracChangeset
for help on using the changeset viewer.