#import "APICast.h"
#import "DateInstance.h"
#import "Error.h"
+#import "Exception.h"
#import "JavaScriptCore.h"
#import "JSContextInternal.h"
#import "JSVirtualMachineInternal.h"
#import <wtf/HashMap.h>
#import <wtf/HashSet.h>
#import <wtf/ObjcRuntimeExtras.h>
+#import <wtf/SpinLock.h>
#import <wtf/Vector.h>
-#import <wtf/TCSpinLock.h>
#import <wtf/text/WTFString.h>
#import <wtf/text/StringHash.h>
return JSValueIsObject([_context JSGlobalContextRef], m_value);
}
+- (BOOL)isArray
+{
+ return JSValueIsArray([_context JSGlobalContextRef], m_value);
+}
+
+- (BOOL)isDate
+{
+ return JSValueIsDate([_context JSGlobalContextRef], m_value);
+}
+
- (BOOL)isEqualToObject:(id)value
{
return JSValueIsStrictEqual([_context JSGlobalContextRef], m_value, objectToValue(_context, value));
}
#if ENABLE(REMOTE_INSPECTOR)
-static void reportExceptionToInspector(JSGlobalContextRef context, JSC::JSValue exception)
+static void reportExceptionToInspector(JSGlobalContextRef context, JSC::JSValue exceptionValue)
{
JSC::ExecState* exec = toJS(context);
+ JSC::Exception* exception = JSC::Exception::create(exec->vm(), exceptionValue);
exec->vmEntryGlobalObject()->inspectorController().reportAPIException(exec, exception);
}
#endif
return nil;
}
- NSString *stringNS = CFBridgingRelease(JSStringCopyCFString(kCFAllocatorDefault, jsstring));
+ RetainPtr<CFStringRef> stringCF = adoptCF(JSStringCopyCFString(kCFAllocatorDefault, jsstring));
JSStringRelease(jsstring);
- return stringNS;
+ return (NSString *)stringCF.autorelease();
}
id valueToDate(JSGlobalContextRef context, JSValueRef value, JSValueRef* exception)
static StructTagHandler* handerForStructTag(const char* encodedType)
{
- static SpinLock handerForStructTagLock = SPINLOCK_INITIALIZER;
+ static StaticSpinLock handerForStructTagLock;
SpinLockHolder lockHolder(&handerForStructTagLock);
static StructHandlers* structHandlers = createStructHandlerMap();