Changeset 11566 in webkit for trunk/JavaScriptCore/kjs/nodes.cpp
- Timestamp:
- Dec 13, 2005, 1:24:53 PM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/kjs/nodes.cpp
r11527 r11566 278 278 279 279 if (o->getPropertySlot(exec, ident, slot)) 280 return slot.getValue(exec, ident);280 return slot.getValue(exec, o, ident); 281 281 282 282 ++iter; … … 354 354 } 355 355 356 // ------------------------------ Property ValueNode----------------------------356 // ------------------------------ PropertyListNode ----------------------------- 357 357 358 358 // ECMA 11.1.5 359 JSValue *Property ValueNode::evaluate(ExecState *exec)359 JSValue *PropertyListNode::evaluate(ExecState *exec) 360 360 { 361 361 JSObject *obj = exec->lexicalInterpreter()->builtinObject()->construct(exec, List::empty()); 362 362 363 for (Property ValueNode *p = this; p; p = p->list.get()) {364 JSValue *n = p->n ame->evaluate(exec);363 for (PropertyListNode *p = this; p; p = p->list.get()) { 364 JSValue *n = p->node->name->evaluate(exec); 365 365 KJS_CHECKEXCEPTIONVALUE 366 JSValue *v = p-> assign->evaluate(exec);366 JSValue *v = p->node->assign->evaluate(exec); 367 367 KJS_CHECKEXCEPTIONVALUE 368 369 obj->put(exec, Identifier(n->toString(exec)), v); 368 369 Identifier propertyName = Identifier(n->toString(exec)); 370 switch (p->node->type) { 371 case PropertyNode::Getter: 372 assert(v->isObject()); 373 obj->defineGetter(exec, propertyName, static_cast<JSObject *>(v)); 374 break; 375 case PropertyNode::Setter: 376 assert(v->isObject()); 377 obj->defineSetter(exec, propertyName, static_cast<JSObject *>(v)); 378 break; 379 case PropertyNode::Constant: 380 obj->put(exec, propertyName, v); 381 break; 382 } 370 383 } 371 384 … … 373 386 } 374 387 375 // ------------------------------ PropertyNode --------------------------------- 376 388 // ------------------------------ PropertyNode ----------------------------- 377 389 // ECMA 11.1.5 378 JSValue *PropertyNode::evaluate(ExecState *) 390 JSValue *PropertyNode::evaluate(ExecState *exec) 391 { 392 assert(false); 393 return jsNull(); 394 } 395 396 // ---------------------------- PropertyNameNode ------------------------------- 397 398 // ECMA 11.1.5 399 JSValue *PropertyNameNode::evaluate(ExecState *) 379 400 { 380 401 JSValue *s; … … 521 542 base = *iter; 522 543 if (base->getPropertySlot(exec, ident, slot)) { 523 JSValue *v = slot.getValue(exec, ident);544 JSValue *v = slot.getValue(exec, base, ident); 524 545 KJS_CHECKEXCEPTIONVALUE 525 546 … … 570 591 if (subscriptVal->getUInt32(i)) { 571 592 if (baseObj->getPropertySlot(exec, i, slot)) 572 funcVal = slot.getValue(exec, i);593 funcVal = slot.getValue(exec, baseObj, i); 573 594 else 574 595 funcVal = jsUndefined(); … … 621 642 JSObject *baseObj = baseVal->toObject(exec); 622 643 PropertySlot slot; 623 JSValue *funcVal = baseObj->getPropertySlot(exec, ident, slot) ? slot.getValue(exec, ident) : jsUndefined();644 JSValue *funcVal = baseObj->getPropertySlot(exec, ident, slot) ? slot.getValue(exec, baseObj, ident) : jsUndefined(); 624 645 KJS_CHECKEXCEPTIONVALUE 625 646 … … 661 682 base = *iter; 662 683 if (base->getPropertySlot(exec, m_ident, slot)) { 663 JSValue *v = slot.getValue(exec, m_ident);684 JSValue *v = slot.getValue(exec, base, m_ident); 664 685 665 686 double n = v->toNumber(exec); … … 691 712 if (subscript->getUInt32(propertyIndex)) { 692 713 PropertySlot slot; 693 JSValue *v = base->getPropertySlot(exec, propertyIndex, slot) ? slot.getValue(exec, propertyIndex) : jsUndefined();714 JSValue *v = base->getPropertySlot(exec, propertyIndex, slot) ? slot.getValue(exec, base, propertyIndex) : jsUndefined(); 694 715 KJS_CHECKEXCEPTIONVALUE 695 716 … … 704 725 Identifier propertyName(subscript->toString(exec)); 705 726 PropertySlot slot; 706 JSValue *v = base->getPropertySlot(exec, propertyName, slot) ? slot.getValue(exec, propertyName) : jsUndefined();727 JSValue *v = base->getPropertySlot(exec, propertyName, slot) ? slot.getValue(exec, base, propertyName) : jsUndefined(); 707 728 KJS_CHECKEXCEPTIONVALUE 708 729 … … 724 745 725 746 PropertySlot slot; 726 JSValue *v = base->getPropertySlot(exec, m_ident, slot) ? slot.getValue(exec, m_ident) : jsUndefined();747 JSValue *v = base->getPropertySlot(exec, m_ident, slot) ? slot.getValue(exec, base, m_ident) : jsUndefined(); 727 748 KJS_CHECKEXCEPTIONVALUE 728 749 … … 849 870 base = *iter; 850 871 if (base->getPropertySlot(exec, m_ident, slot)) { 851 JSValue *v = slot.getValue(exec, m_ident);872 JSValue *v = slot.getValue(exec, base, m_ident); 852 873 return typeStringForValue(v); 853 874 } … … 887 908 base = *iter; 888 909 if (base->getPropertySlot(exec, m_ident, slot)) { 889 JSValue *v = slot.getValue(exec, m_ident);910 JSValue *v = slot.getValue(exec, base, m_ident); 890 911 891 912 double n = v->toNumber(exec); … … 918 939 if (subscript->getUInt32(propertyIndex)) { 919 940 PropertySlot slot; 920 JSValue *v = base->getPropertySlot(exec, propertyIndex, slot) ? slot.getValue(exec, propertyIndex) : jsUndefined();941 JSValue *v = base->getPropertySlot(exec, propertyIndex, slot) ? slot.getValue(exec, base, propertyIndex) : jsUndefined(); 921 942 KJS_CHECKEXCEPTIONVALUE 922 943 … … 932 953 Identifier propertyName(subscript->toString(exec)); 933 954 PropertySlot slot; 934 JSValue *v = base->getPropertySlot(exec, propertyName, slot) ? slot.getValue(exec, propertyName) : jsUndefined();955 JSValue *v = base->getPropertySlot(exec, propertyName, slot) ? slot.getValue(exec, base, propertyName) : jsUndefined(); 935 956 KJS_CHECKEXCEPTIONVALUE 936 957 … … 953 974 954 975 PropertySlot slot; 955 JSValue *v = base->getPropertySlot(exec, m_ident, slot) ? slot.getValue(exec, m_ident) : jsUndefined();976 JSValue *v = base->getPropertySlot(exec, m_ident, slot) ? slot.getValue(exec, base, m_ident) : jsUndefined(); 956 977 KJS_CHECKEXCEPTIONVALUE 957 978 … … 1292 1313 v = m_right->evaluate(exec); 1293 1314 } else { 1294 JSValue *v1 = slot.getValue(exec, m_ident);1315 JSValue *v1 = slot.getValue(exec, base, m_ident); 1295 1316 KJS_CHECKEXCEPTIONVALUE 1296 1317 JSValue *v2 = m_right->evaluate(exec); … … 1318 1339 } else { 1319 1340 PropertySlot slot; 1320 JSValue *v1 = base->getPropertySlot(exec, m_ident, slot) ? slot.getValue(exec, m_ident) : jsUndefined();1341 JSValue *v1 = base->getPropertySlot(exec, m_ident, slot) ? slot.getValue(exec, base, m_ident) : jsUndefined(); 1321 1342 KJS_CHECKEXCEPTIONVALUE 1322 1343 JSValue *v2 = m_right->evaluate(exec); … … 1348 1369 } else { 1349 1370 PropertySlot slot; 1350 JSValue *v1 = base->getPropertySlot(exec, propertyIndex, slot) ? slot.getValue(exec, propertyIndex) : jsUndefined();1371 JSValue *v1 = base->getPropertySlot(exec, propertyIndex, slot) ? slot.getValue(exec, base, propertyIndex) : jsUndefined(); 1351 1372 KJS_CHECKEXCEPTIONVALUE 1352 1373 JSValue *v2 = m_right->evaluate(exec); … … 1367 1388 } else { 1368 1389 PropertySlot slot; 1369 JSValue *v1 = base->getPropertySlot(exec, propertyName, slot) ? slot.getValue(exec, propertyName) : jsUndefined();1390 JSValue *v1 = base->getPropertySlot(exec, propertyName, slot) ? slot.getValue(exec, base, propertyName) : jsUndefined(); 1370 1391 KJS_CHECKEXCEPTIONVALUE 1371 1392 JSValue *v2 = m_right->evaluate(exec);
Note:
See TracChangeset
for help on using the changeset viewer.