Ignore:
Timestamp:
Jul 7, 2010, 7:10:50 AM (15 years ago)
Author:
[email protected]
Message:

2010-07-07 Caio Marcelo de Oliveira Filho <[email protected]>

Reviewed by Kenneth Rohde Christiansen.

Implementation of QScriptValue::isArray()
https://bugs.webkit.org/show_bug.cgi?id=41713

Since we don't have access to the Class internal property of
builtins (including Array), the solution was to keep the original 'Array'
(constructor) and 'Array.prototype' objects and use them to identify
if a given object is an Array.

Also uncomment some tests and add some tests of newArray() that
depended on isArray().

  • api/qscriptengine_p.cpp: (QScriptEnginePrivate::QScriptEnginePrivate): (QScriptEnginePrivate::~QScriptEnginePrivate):
  • api/qscriptengine_p.h: (QScriptEnginePrivate::isArray):
  • api/qscriptvalue.cpp: (QScriptValue::isArray):
  • api/qscriptvalue.h:
  • api/qscriptvalue_p.h: (QScriptValuePrivate::isArray):
  • tests/qscriptengine/tst_qscriptengine.cpp: (tst_QScriptEngine::newArray):
File:
1 edited

Legend:

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

    r62547 r62661  
    311311{
    312312    return d_ptr->isError();
     313}
     314
     315/*!
     316  Returns true if this QScriptValue is an object of the Array class;
     317  otherwise returns false.
     318
     319  \sa QScriptEngine::newArray()
     320*/
     321bool QScriptValue::isArray() const
     322{
     323    return d_ptr->isArray();
    313324}
    314325
Note: See TracChangeset for help on using the changeset viewer.