Changeset 62547 in webkit for trunk/JavaScriptCore/qt/api/qscriptvalue.cpp
- Timestamp:
- Jul 6, 2010, 6:55:34 AM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/qt/api/qscriptvalue.cpp
r62007 r62547 652 652 \overload 653 653 654 Returns the value of this QScriptValue's property with the given \a name, 655 using the given \a mode to resolve the property. 656 657 This overload of property() is useful when you need to look up the 658 same property repeatedly, since the lookup can be performed faster 659 when the name is represented as an interned string. 660 661 \sa QScriptEngine::toStringHandle(), setProperty() 662 */ 663 QScriptValue QScriptValue::property(const QScriptString& name, const ResolveFlags& mode) const 664 { 665 return QScriptValuePrivate::get(d_ptr->property(QScriptStringPrivate::get(name).constData(), mode)); 666 } 667 668 /*! 669 \overload 670 654 671 Returns the property at the given \a arrayIndex, using the given \a 655 672 mode to resolve the property. … … 666 683 return QScriptValuePrivate::get(d_ptr->property(arrayIndex, mode)); 667 684 } 685 686 /*! 687 Sets the value of this QScriptValue's property with the given \a name to 688 the given \a value. 689 690 If this QScriptValue is not an object, this function does nothing. 691 692 If this QScriptValue does not already have a property with name \a name, 693 a new property is created; the given \a flags then specify how this 694 property may be accessed by script code. 695 696 If \a value is invalid, the property is removed. 697 698 If the property is implemented using a setter function (i.e. has the 699 PropertySetter flag set), calling setProperty() has side-effects on 700 the script engine, since the setter function will be called with the 701 given \a value as argument (possibly resulting in an uncaught script 702 exception). 703 704 Note that you cannot specify custom getter or setter functions for 705 built-in properties, such as the \c{length} property of Array objects 706 or meta properties of QObject objects. 707 708 \sa property() 709 */ 710 void QScriptValue::setProperty(const QString& name, const QScriptValue& value, const PropertyFlags& flags) 711 { 712 d_ptr->setProperty(name, QScriptValuePrivate::get(value), flags); 713 } 714 715 /*! 716 \overload 717 718 Sets the property at the given \a arrayIndex to the given \a value. 719 720 This function is provided for convenience and performance when 721 working with array objects. 722 723 If this QScriptValue is not an Array object, this function behaves 724 as if setProperty() was called with the string representation of \a 725 arrayIndex. 726 */ 727 void QScriptValue::setProperty(quint32 arrayIndex, const QScriptValue& value, const PropertyFlags& flags) 728 { 729 d_ptr->setProperty(arrayIndex, QScriptValuePrivate::get(value), flags); 730 } 731 732 /*! 733 Sets the value of this QScriptValue's property with the given \a 734 name to the given \a value. The given \a flags specify how this 735 property may be accessed by script code. 736 737 This overload of setProperty() is useful when you need to set the 738 same property repeatedly, since the operation can be performed 739 faster when the name is represented as an interned string. 740 741 \sa QScriptEngine::toStringHandle() 742 */ 743 void QScriptValue::setProperty(const QScriptString& name, const QScriptValue& value, const PropertyFlags& flags) 744 { 745 d_ptr->setProperty(QScriptStringPrivate::get(name).constData(), QScriptValuePrivate::get(value), flags); 746 }
Note:
See TracChangeset
for help on using the changeset viewer.