Skip to content

Commit 05b40b0

Browse files
committed
Downgrade to 538.11.1 due to stability issues
1 parent 176103b commit 05b40b0

File tree

229 files changed

+3387
-8247
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

229 files changed

+3387
-8247
lines changed

JavaScriptCore/API/JSBase.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ JS_EXPORT void JSGarbageCollect(JSContextRef ctx);
144144
#ifndef JSC_OBJC_API_AVAILABLE_MAC_OS_X_1080
145145
#define JSC_OBJC_API_ENABLED (defined(__clang__) && defined(__APPLE__) && ((defined(__MAC_OS_X_VERSION_MIN_REQUIRED) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 1090 && !defined(__i386__)) || (defined(TARGET_OS_IPHONE) && TARGET_OS_IPHONE)))
146146
#else
147-
#define JSC_OBJC_API_ENABLED (defined(__clang__) && defined(__APPLE__) && ((defined(__MAC_OS_X_VERSION_MIN_REQUIRED) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 1080 && !defined(__i386__)) || (defined(TARGET_OS_IPHONE) && TARGET_OS_IPHONE)))
147+
#define JSC_OBJC_API_ENABLED (defined(__clang__) && defined(__APPLE__) && defined(__MAC_OS_X_VERSION_MIN_REQUIRED) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 1080 && !defined(__i386__))
148148
#endif
149149
#endif
150150

JavaScriptCore/API/JSStringRef.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ size_t JSStringGetLength(JSStringRef string)
8383

8484
const JSChar* JSStringGetCharactersPtr(JSStringRef string)
8585
{
86-
return string->deprecatedCharacters();
86+
return string->characters();
8787
}
8888

8989
size_t JSStringGetMaximumUTF8CStringSize(JSStringRef string)
@@ -98,7 +98,7 @@ size_t JSStringGetUTF8CString(JSStringRef string, char* buffer, size_t bufferSiz
9898
return 0;
9999

100100
char* p = buffer;
101-
const UChar* d = string->deprecatedCharacters();
101+
const UChar* d = string->characters();
102102
ConversionResult result = convertUTF16ToUTF8(&d, d + string->length(), &p, p + bufferSize - 1, true);
103103
*p++ = '\0';
104104
if (result != conversionOK && result != targetExhausted)
@@ -110,7 +110,7 @@ size_t JSStringGetUTF8CString(JSStringRef string, char* buffer, size_t bufferSiz
110110
bool JSStringIsEqual(JSStringRef a, JSStringRef b)
111111
{
112112
unsigned len = a->length();
113-
return len == b->length() && 0 == memcmp(a->deprecatedCharacters(), b->deprecatedCharacters(), len * sizeof(UChar));
113+
return len == b->length() && 0 == memcmp(a->characters(), b->characters(), len * sizeof(UChar));
114114
}
115115

116116
bool JSStringIsEqualToUTF8CString(JSStringRef a, const char* b)

JavaScriptCore/API/JSStringRefCF.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,5 +61,5 @@ CFStringRef JSStringCopyCFString(CFAllocatorRef alloc, JSStringRef string)
6161
if (!string->length())
6262
return CFSTR("");
6363

64-
return CFStringCreateWithCharacters(alloc, reinterpret_cast<const UniChar*>(string->deprecatedCharacters()), string->length());
64+
return CFStringCreateWithCharacters(alloc, reinterpret_cast<const UniChar*>(string->characters()), string->length());
6565
}

JavaScriptCore/API/JSWrapperMap.mm

Lines changed: 2 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -98,16 +98,6 @@ - (JSObjCClassInfo*)classInfoForClass:(Class)cls;
9898
return result;
9999
}
100100

101-
static bool constructorHasInstance(JSContextRef ctx, JSObjectRef constructorRef, JSValueRef possibleInstance, JSValueRef*)
102-
{
103-
JSC::ExecState* exec = toJS(ctx);
104-
JSC::APIEntryShim entryShim(exec);
105-
106-
JSC::JSObject* constructor = toJS(constructorRef);
107-
JSC::JSValue instance = toJS(exec, possibleInstance);
108-
return JSC::JSObject::defaultHasInstance(exec, instance, constructor->get(exec, exec->propertyNames().prototype));
109-
}
110-
111101
static JSObjectRef makeWrapper(JSContextRef ctx, JSClassRef jsClass, id wrappedObject)
112102
{
113103
JSC::ExecState* exec = toJS(ctx);
@@ -136,18 +126,6 @@ static JSObjectRef makeWrapper(JSContextRef ctx, JSClassRef jsClass, id wrappedO
136126
return [JSValue valueWithJSValueRef:result inContext:context];
137127
}
138128

139-
static JSValue *constructorWithCustomBrand(JSContext *context, NSString *brand, Class cls)
140-
{
141-
JSClassDefinition definition;
142-
definition = kJSClassDefinitionEmpty;
143-
definition.className = [brand UTF8String];
144-
definition.hasInstance = constructorHasInstance;
145-
JSClassRef classRef = JSClassCreate(&definition);
146-
JSObjectRef result = makeWrapper([context JSGlobalContextRef], classRef, cls);
147-
JSClassRelease(classRef);
148-
return [JSValue valueWithJSValueRef:result inContext:context];
149-
}
150-
151129
// Look for @optional properties in the prototype containing a selector to property
152130
// name mapping, separated by a __JS_EXPORT_AS__ delimiter.
153131
static NSMutableDictionary *createRenameMap(Protocol *protocol, BOOL isInstanceMethod)
@@ -401,7 +379,7 @@ - (void)dealloc
401379
static JSValue *allocateConstructorForCustomClass(JSContext *context, const char* className, Class cls)
402380
{
403381
if (!supportsInitMethodConstructors())
404-
return constructorWithCustomBrand(context, [NSString stringWithFormat:@"%sConstructor", className], cls);
382+
return objectWithCustomBrand(context, [NSString stringWithFormat:@"%sConstructor", className], cls);
405383

406384
// For each protocol that the class implements, gather all of the init family methods into a hash table.
407385
__block HashMap<String, Protocol *> initTable;
@@ -447,7 +425,7 @@ - (void)dealloc
447425
JSObjectRef method = objCCallbackFunctionForInit(context, cls, initProtocol, initMethod, types);
448426
return [JSValue valueWithJSValueRef:method inContext:context];
449427
}
450-
return constructorWithCustomBrand(context, [NSString stringWithFormat:@"%sConstructor", className], cls);
428+
return objectWithCustomBrand(context, [NSString stringWithFormat:@"%sConstructor", className], cls);
451429
}
452430

453431
- (void)allocateConstructorAndPrototypeWithSuperClassInfo:(JSObjCClassInfo*)superClassInfo

JavaScriptCore/API/OpaqueJSString.h

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,8 @@ struct OpaqueJSString : public ThreadSafeRefCounted<OpaqueJSString> {
5353

5454
JS_EXPORT_PRIVATE static PassRefPtr<OpaqueJSString> create(const String&);
5555

56-
const UChar* characters() { return deprecatedCharacters(); } // FIXME: Delete this.
57-
const UChar* deprecatedCharacters() { return this ? m_string.deprecatedCharacters() : nullptr; }
58-
unsigned length() { return this ? m_string.length() : 0; }
56+
const UChar* characters() { return !!this ? m_string.characters() : 0; }
57+
unsigned length() { return !!this ? m_string.length() : 0; }
5958

6059
JS_EXPORT_PRIVATE String string() const;
6160
JSC::Identifier identifier(JSC::VM*) const;
@@ -73,13 +72,13 @@ struct OpaqueJSString : public ThreadSafeRefCounted<OpaqueJSString> {
7372
}
7473

7574
OpaqueJSString(const LChar* characters, unsigned length)
76-
: m_string(characters, length)
7775
{
76+
m_string = String(characters, length);
7877
}
7978

8079
OpaqueJSString(const UChar* characters, unsigned length)
81-
: m_string(characters, length)
8280
{
81+
m_string = String(characters, length);
8382
}
8483

8584
String m_string;

0 commit comments

Comments
 (0)