Allow .pragma library scripts to import other scripts
Previously, a .pragma library script would have a new context which
did not have an engine set. If the script then imported other scripts
a crash would occur due to dereferencing the (null) engine ptr.
This commit ensures that even if no parent context is used (eg, for
shared scripts which don't import the parent context) the engine from
the parent context is used as the engine in the new context.
Finally, unit tests for the .pragma library import with imports cases
were added to tst_qdeclarativeecmascript.
Task-number: QTBUG-21620
Change-Id: I671ffc9eee98a69cce7c169ce5b9d5aae4d1ff0d
Reviewed-on: http://codereview.qt-project.org/5421
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Aaron Kennedy <aaron.kennedy@nokia.com>