The attached example causes a crash with QtScript based on JavaScriptCore
The problem is that MyObjectClass::property(...) returns a default-constructed QScriptValue, which is converted to a default constructed JSC::JSValue in QScriptEnginePrivate::scriptValueToJSCValue(...). A default-constructed JSC::JSValue has tag EmptyValueTag. Now there is an EmptyValueTag-tagged JSValue in the wild, which the example later tries to print causing JSValue::toString(...) to be called, which is not prepared to deal with the EmptyValueTag causing it to invoke JSValue::asCell() which then goes boom.
If MyObjectClass::property(...) is modified to return QScriptValue(QScriptValue::UndefinedValue) the problem goes away.
Probably the (invalid) default constructed QScriptValue returned from the QScriptClass::property(...) specialization should be converted to an undefined rather than an empty JSC::JSValue.
Perhaps JSValue::toString(..) should be equipped to either turn an empty value into a string or contain a note that empty JSValue's are not supposed to be let loose.