Don't crash when creating backtrace for built-in JS function
authorKent Hansen <kent.hansen@nokia.com>
Thu, 3 Feb 2011 11:28:27 +0000 (12:28 +0100)
committerJason McDonald <jason.mcdonald@nokia.com>
Wed, 9 Feb 2011 07:16:01 +0000 (17:16 +1000)
commit713f07486de353f30fb63d2e2e3b17202a5d4a1b
treec1471148c584aecb230b972227ceecf37ac0bfb4
parent70cacb48b0bdbfe6ca58b7472cbeadb18d4dfc35
Don't crash when creating backtrace for built-in JS function

When the JIT is enabled, NativeFunctionWrapper (used for
built-in functions such as Array.prototype.forEach) inherits
JSFunction, so we must check whether the function is
actually a JS (script) function before we start accessing
script-specific properties.

Task-number: QTBUG-17137
Reviewed-by: Olivier Goffart
(cherry picked from commit 147df10403ba280b3f04c1e3d6c4b1cf386abe5d)
src/script/api/qscriptcontextinfo.cpp
tests/auto/qscriptcontext/tst_qscriptcontext.cpp