=== JavaScriptGlue-418 === 2006-04-25 Timothy Hatcher Merged fix from TOT to Safari-2-0-branch 2006-03-31 Geoffrey Garen Reviewed by Darin. - Fixed JavaScript patch crashing Quartz Composer JSValueWrappers used to hold on to the ExecState that pertained at the time of their creation. Since ExecStates are transient, that design was totally bogus, and it would crash once the ExecState had been deallocated. Unfortunately, there's no clean solution to this problem, since the JSGlue API has no notion of state. The solution here is to use a shared, global ExecState for the purpose of JSGlue calls. Given the pre-existing limitations in the JSGlue API, this design shouldn't actually introduce any new limitations (see comments in JSValueWrapper.cpp). I tested with Quartz Composer and PAC files, neither of which are layout-testable. * JSUtils.cpp: (KJSValueToJSObject): * JSValueWrapper.cpp: (JSValueWrapper::JSValueWrapper): (JSValueWrapper::GetValue): (getProcessGlobalExecState): (JSValueWrapper::JSObjectCopyPropertyNames): (JSValueWrapper::JSObjectCopyProperty): (JSValueWrapper::JSObjectSetProperty): (JSValueWrapper::JSObjectCallFunction): (JSValueWrapper::JSObjectCopyCFValue): * JSValueWrapper.h: Also added a test harness file. It was helpful while I was testing, and may come in handy in the future: * JavaScriptGlue.xcodeproj/project.pbxproj: testjsglue.cpp: Added. === JavaScriptGlue-417 === 2005-09-14 Maciej Stachowiak Reviewed by Geoff. - fixed REGRESSION: kjs_fast_malloc crash due to lack of locking on multiple threads (seen selecting volumes in the installer) Make sure to lock using the InterpreterLock class in all places that need it (including anything that uses the collector, the parser, the protect count hash table, and anything that allocates via fast_malloc). * JSUtils.cpp: (CFStringToUString): (JSObjectKJSValue): (KJSValueToCFTypeInternal): * JSUtils.h: * JSValueWrapper.cpp: (JSValueWrapper::JSObjectCopyPropertyNames): (JSValueWrapper::JSObjectCopyProperty): (JSValueWrapper::JSObjectSetProperty): (JSValueWrapper::JSObjectCallFunction): (JSValueWrapper::JSObjectCopyCFValue): * JavaScriptGlue.cpp: (JSCollect): === Safari-416.6 === 2005-09-08 Adele Peterson Reviewed by Geoff and Tim. Converting project to XCode 2.1 on the Safari-2-0-branch * JavaScriptGlue.pbproj/project.pbxproj: Removed. * JavaScriptGlue.xcodeproj/.cvsignore: Added. * JavaScriptGlue.xcodeproj/project.pbxproj: Added. 2005-09-02 Maciej Stachowiak Reviewed by John. - fixed Denver Regression: for (x in y) broken in JavaScriptGlue (could cause crash) * UserObjectImp.cpp: (UserObjectImp::hasOwnProperty): Renamed from hasProperty and implemented in a lower-level way, to avoid relying on get. * UserObjectImp.h: 2005-09-01 Maciej Stachowiak Rubber stamped by hyatt. - initial import of JavaScriptGlue into our repository * English.lproj/InfoPlist.strings: Added. * JSBase.cpp: Added. (JSBase::JSBase): (JSBase::~JSBase): (JSBase::Retain): (JSBase::Release): (JSBase::RetainCount): (JSBase::GetTypeID): (JSBase::CopyDescription): (JSBase::Equal): * JSBase.h: Added. * JSObject.cpp: Added. (JSUserObject::JSUserObject): (JSUserObject::~JSUserObject): (JSUserObject::CopyPropertyNames): (JSUserObject::CopyProperty): (JSUserObject::SetProperty): (JSUserObject::ImplementsCall): (JSUserObject::CallFunction): (JSUserObject::CopyCFValue): (JSUserObject::Equal): (JSUserObject::Mark): (JSUserObject::GetData): * JSObject.h: Added. (JSUserObject::DataType): * JSRun.cpp: Added. (JSRun::JSRun): (JSRun::~JSRun): (JSRun::Flags): (JSRun::GetSource): (JSRun::GlobalObject): (JSRun::GetInterpreter): (JSRun::Evaluate): (JSRun::CheckSyntax): * JSRun.h: Added. (JSInterpreter::JSInterpreter): (JSInterpreter::JSInterpreter::~JSInterpreter): (JSInterpreter::Flags): * JSUtils.cpp: Added. (CFStringToUString): (UStringToCFString): (CFStringToIdentifier): (IdentifierToCFString): (KJSValueToJSObject): (JSObjectKJSValue): (KJSValueToCFTypeInternal): (KJSValueToCFType): (GetCFNull): * JSUtils.h: Added. (RetainCFType): (ReleaseCFType): * JSValueWrapper.cpp: Added. (JSValueWrapper::JSValueWrapper): (JSValueWrapper::~JSValueWrapper): (JSValueWrapper::GetValue): (JSValueWrapper::GetExecState): (JSValueWrapper::GetJSObectCallBacks): (JSValueWrapper::JSObjectDispose): (JSValueWrapper::JSObjectCopyPropertyNames): (JSValueWrapper::JSObjectCopyProperty): (JSValueWrapper::JSObjectSetProperty): (JSValueWrapper::JSObjectCallFunction): (JSValueWrapper::JSObjectCopyCFValue): (JSValueWrapper::JSObjectMark): * JSValueWrapper.h: Added. * JavaScriptGlue.cpp: Added. (JSSetCFNull): (JSGetCFNull): (JSRetain): (JSRelease): (JSCopyDescription): (JSEqual): (JSGetTypeID): (JSGetRetainCount): (JSObjectCreate): (JSObjectCreateInternal): (JSObjectCopyCFValue): (JSObjectGetData): (JSObjectCopyProperty): (JSObjectSetProperty): (JSObjectCallFunction): (JSRunCreate): (JSRunCopySource): (JSRunCopyGlobalObject): (JSRunEvaluate): (JSRunCheckSyntax): (JSCollect): (JSTypeGetCFArrayCallBacks): (JSCFRetain): (JSCFRelease): (JSObjectCreateWithCFType): (CFJSObjectDispose): (JSObjectCopyPropertyNames): (CFJSObjectCopyProperty): (CFJSObjectSetProperty): (CFJSObjectCopyCFValue): (CFJSObjectEqual): (CFJSObjectCopyPropertyNames): (JSCreateCFArrayFromJSArray): (JSCreateJSArrayFromCFArray): (JSLockInterpreter): (JSUnlockInterpreter): * JavaScriptGlue.exp: Added. * JavaScriptGlue.h: Added. * JavaScriptGlue.pbproj/project.pbxproj: Added. * UserObjectImp.cpp: Added. (UserObjectPrototypeImp::UserObjectPrototypeImp): (UserObjectPrototypeImp::GlobalUserObjectPrototypeImp): (UserObjectImp::UserObjectImp): (UserObjectImp::~UserObjectImp): (UserObjectImp::classInfo): (UserObjectImp::implementsCall): (UserObjectImp::call): (UserObjectImp::propList): (UserObjectImp::hasProperty): (UserObjectImp::get): (UserObjectImp::put): (UserObjectImp::GetJSUserObject): (UserObjectImp::toPrimitive): (UserObjectImp::toBoolean): (UserObjectImp::toNumber): (UserObjectImp::toString): (UserObjectImp::mark): * UserObjectImp.h: Added.