/*! If this QScriptValue is an object, sets the internal prototype (\c{__proto__} property) of this object to be \a prototype; otherwise does nothing. The internal prototype should not be confused with the public property with name "prototype"; the public prototype is usually only set on functions that act as constructors. \sa prototype(), isObject() */ void QScriptValue::setPrototype(const QScriptValue &prototype) { if (!isObject()) return; if (prototype.isValid() && (prototype.engine() != engine())) { qWarning("QScriptValue::setPrototype() failed: " "cannot set a prototype created in " "a different engine"); return; } QScriptValueImpl self = QScriptValuePrivate::valueOf(*this); QScriptValueImpl was = self.prototype(); self.setPrototype(QScriptValuePrivate::valueOf(prototype)); if (self.detectedCycle()) { qWarning("QScriptValue::setPrototype() failed: " "cyclic prototype value"); self.setPrototype(was); } }