Ignore:
Timestamp:
Jun 4, 2010, 5:23:07 PM (15 years ago)
Author:
[email protected]
Message:

2010-06-04 Jedrzej Nowacki <[email protected]>

Reviewed by Kenneth Rohde Christiansen.

New QtScript API; QScriptValue::instanceOf.

New function create an easy way to check value's prototype hierarchy.

[Qt] QScriptValue should have an instanceOf method
https://bugs.webkit.org/show_bug.cgi?id=40120

  • qt/api/qscriptvalue.cpp: (QScriptValue::instanceOf):
  • qt/api/qscriptvalue.h:
  • qt/api/qscriptvalue_p.h: (QScriptValuePrivate::instanceOf):
  • qt/tests/qscriptvalue/tst_qscriptvalue.h:
  • qt/tests/qscriptvalue/tst_qscriptvalue_generated_comparison.cpp: (tst_QScriptValue::instanceOf_initData): (tst_QScriptValue::instanceOf_makeData): (tst_QScriptValue::instanceOf_test):
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/qt/api/qscriptvalue.cpp

    r60661 r60725  
    586586    return d_ptr->strictlyEquals(QScriptValuePrivate::get(other));
    587587}
     588
     589/*!
     590    Returns true if this QScriptValue is an instance of
     591    \a other; otherwise returns false.
     592
     593    This QScriptValue is considered to be an instance of \a other if
     594    \a other is a function and the value of the \c{prototype}
     595    property of \a other is in the prototype chain of this
     596    QScriptValue.
     597*/
     598bool QScriptValue::instanceOf(const QScriptValue& other) const
     599{
     600    return d_ptr->instanceOf(QScriptValuePrivate::get(other));
     601}
Note: See TracChangeset for help on using the changeset viewer.