Changeset 202670 in webkit
- Timestamp:
- Jun 29, 2016 9:46:51 PM (8 years ago)
- Location:
- trunk/Source/JavaScriptCore
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/API/JSWrapperMap.mm
r200866 r202670 28 28 29 29 #if JSC_OBJC_API_ENABLED 30 31 30 #import "APICast.h" 32 31 #import "JSAPIWrapperObject.h" … … 47 46 48 47 #if PLATFORM(APPLETV) 49 #elif PLATFORM(IOS) 50 static const uint32_t firstSDKVersionWithInitConstructorSupport = 0x80000; // iOS 8.0.0 48 #else 49 static const int32_t firstJavaScriptCoreVersionWithInitConstructorSupport = 0x21A0400; // 538.4.0 50 #if PLATFORM(IOS) 51 static const uint32_t firstSDKVersionWithInitConstructorSupport = DYLD_IOS_VERSION_10_0; 51 52 #elif PLATFORM(MAC) 52 53 static const uint32_t firstSDKVersionWithInitConstructorSupport = 0xA0A00; // OSX 10.10.0 54 #endif 53 55 #endif 54 56 … … 658 660 return true; 659 661 #else 662 // First check to see the version of JavaScriptCore we directly linked against. 663 static int32_t versionOfLinkTimeJavaScriptCore = 0; 664 if (!versionOfLinkTimeJavaScriptCore) 665 versionOfLinkTimeJavaScriptCore = NSVersionOfLinkTimeLibrary("JavaScriptCore"); 666 // Only do the link time version comparison if we linked directly with JavaScriptCore 667 if (versionOfLinkTimeJavaScriptCore != -1) 668 return versionOfLinkTimeJavaScriptCore >= firstJavaScriptCoreVersionWithInitConstructorSupport; 669 670 // If we didn't link directly with JavaScriptCore, 671 // base our check on what SDK was used to build the application. 660 672 static uint32_t programSDKVersion = 0; 661 673 if (!programSDKVersion) 662 674 programSDKVersion = dyld_get_program_sdk_version(); 675 663 676 return programSDKVersion >= firstSDKVersionWithInitConstructorSupport; 664 677 #endif -
trunk/Source/JavaScriptCore/ChangeLog
r202667 r202670 1 2016-06-29 Michael Saboff <msaboff@apple.com> 2 3 REGRESSION(200114): Netflix app does not see ChromeCast 4 https://bugs.webkit.org/show_bug.cgi?id=159287 5 6 Reviewed by Benjamin Poulain. 7 8 Change set 200114 changed the behavior of how we check for whether or not we 9 wrap Objective C init methods in JavaScript constructors. The prior method 10 checked the version of JavaScriptCore that was linked with the application. 11 If the application was not directly linked with JavaScriptCore the prior 12 method indicated that we shouldn't create constructors. The new method uses 13 the SDK the application was compiled with. Using the new method, an 14 application compiled with iOS SDK 8.0 or greater would create constructors 15 and not export init methods to JavaScript. The problem is that an existing 16 application that hasn't been recompiled will get a different answer using 17 the new method. We need to come up with a method that works in a compatible 18 way with existing programs, but provides a newly compiled program with the 19 "is built with SDK N or greater" check. 20 21 Added back the prior check of the version of JavaScriptCore the program was 22 directly linked against. However we only use this check if we directly linked 23 with JavaScriptCore. Otherwise we fall through to check against the SDK the 24 program was built with. Changed the iOS SDK version we check 25 against to be the new version of iOS, iOS 10. 26 27 This provides compatible behavior for existing programs. It may be the case 28 that some of those programs may require changes when they are rebuilt with the 29 iOS 10 SDK or later. 30 31 * API/JSWrapperMap.mm: 32 (supportsInitMethodConstructors): 33 1 34 2016-06-29 Benjamin Poulain <bpoulain@apple.com> 2 35
Note: See TracChangeset
for help on using the changeset viewer.