Changeset 769 for trunk/src/script/api/qscriptvalue.cpp
- Timestamp:
- Aug 2, 2010, 9:27:30 PM (15 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk
- Property svn:mergeinfo changed
/branches/vendor/nokia/qt/4.6.3 (added) merged: 768 /branches/vendor/nokia/qt/current merged: 767 /branches/vendor/nokia/qt/4.6.2 removed
- Property svn:mergeinfo changed
-
trunk/src/script/api/qscriptvalue.cpp
r651 r769 793 793 return; 794 794 } 795 JSC::JSObject *thisObject = JSC::asObject(d->jscValue); 795 796 JSC::JSValue other = d->engine->scriptValueToJSCValue(prototype); 796 797 … … 799 800 while (nextPrototypeValue && nextPrototypeValue.isObject()) { 800 801 JSC::JSObject *nextPrototype = JSC::asObject(nextPrototypeValue); 801 if (nextPrototype == JSC::asObject(d->jscValue)) {802 if (nextPrototype == thisObject) { 802 803 qWarning("QScriptValue::setPrototype() failed: cyclic prototype value"); 803 804 return; … … 805 806 nextPrototypeValue = nextPrototype->prototype(); 806 807 } 807 JSC::asObject(d->jscValue)->setPrototype(other); 808 809 thisObject->setPrototype(other); 810 811 // Sync the internal Global Object prototype if appropriate. 812 if (((thisObject == d->engine->originalGlobalObjectProxy) 813 && !d->engine->customGlobalObject()) 814 || (thisObject == d->engine->customGlobalObject())) { 815 d->engine->originalGlobalObject()->setPrototype(other); 816 } 808 817 } 809 818 … … 1149 1158 1150 1159 if (d->type != other.d_ptr->type) { 1151 if (d->type == QScriptValuePrivate::JavaScriptCore) 1152 return JSC::JSValue::strictEqual(d->jscValue, d->engine->scriptValueToJSCValue(other)); 1153 else if (other.d_ptr->type == QScriptValuePrivate::JavaScriptCore) 1154 return JSC::JSValue::strictEqual(other.d_ptr->engine->scriptValueToJSCValue(*this), other.d_ptr->jscValue); 1160 if (d->type == QScriptValuePrivate::JavaScriptCore) { 1161 QScriptEnginePrivate *eng_p = d->engine ? d->engine : other.d_ptr->engine; 1162 if (eng_p) 1163 return JSC::JSValue::strictEqual(d->jscValue, eng_p->scriptValueToJSCValue(other)); 1164 } else if (other.d_ptr->type == QScriptValuePrivate::JavaScriptCore) { 1165 QScriptEnginePrivate *eng_p = other.d_ptr->engine ? other.d_ptr->engine : d->engine; 1166 if (eng_p) 1167 return JSC::JSValue::strictEqual(eng_p->scriptValueToJSCValue(*this), other.d_ptr->jscValue); 1168 } 1155 1169 1156 1170 return false; … … 1942 1956 if (!array.isUndefinedOrNull()) { 1943 1957 if (!array.isObject()) { 1944 return d->engine->scriptValueFromJSCValue(JSC::throwError(exec, JSC::TypeError ));1958 return d->engine->scriptValueFromJSCValue(JSC::throwError(exec, JSC::TypeError, "Arguments must be an array")); 1945 1959 } 1946 1960 if (JSC::asObject(array)->classInfo() == &JSC::Arguments::info) … … 1953 1967 applyArgs.append(JSC::asArray(array)->get(exec, i)); 1954 1968 } else { 1955 Q_ASSERT_X(false, Q_FUNC_INFO, "implement me"); 1956 // return JSC::throwError(exec, JSC::TypeError); 1969 return d->engine->scriptValueFromJSCValue(JSC::throwError(exec, JSC::TypeError, "Arguments must be an array")); 1957 1970 } 1958 1971 }
Note:
See TracChangeset
for help on using the changeset viewer.