New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Expose compile time constants in metadata as JSCode #279
Comments
ivanbuhov
added
1 - Backlog
severity: medium
bug
severity: low
and removed
severity: medium
labels
Aug 24, 2015
Here is an incomplete list of some static const CFIndex kCFNotFound = -1;
static const CGFontIndex kCGFontIndexInvalid = ((1 << 16) - 1);
static const CGFontIndex kCGFontIndexMax = ((1 << 16) - 2);
static const CGFontIndex kCGGlyphMax = kCGFontIndexMax;
static const Float64 kAudioStreamAnyRate = 0.0;
static const MIDIObjectType kMIDIObjectType_ExternalMask = (MIDIObjectType)0x10;
static const NSExpressionType NSFetchRequestExpressionType = (NSExpressionType)50;
static const NSInteger NSNotFound = NSIntegerMax;
static const NSInteger NSOperationQueueDefaultMaxConcurrentOperationCount = -1;
static const NSPointerFunctionsOptions NSHashTableCopyIn = NSPointerFunctionsCopyIn;
static const NSPointerFunctionsOptions NSHashTableObjectPointerPersonality = NSPointerFunctionsObjectPointerPersonality;
static const NSPointerFunctionsOptions NSHashTableStrongMemory = NSPointerFunctionsStrongMemory;
static const NSPointerFunctionsOptions NSHashTableWeakMemory = NSPointerFunctionsWeakMemory;
static const NSPointerFunctionsOptions NSHashTableZeroingWeakMemory = NSPointerFunctionsZeroingWeakMemory;
static const NSPointerFunctionsOptions NSMapTableCopyIn = NSPointerFunctionsCopyIn;
static const NSPointerFunctionsOptions NSMapTableObjectPointerPersonality = NSPointerFunctionsObjectPointerPersonality;
static const NSPointerFunctionsOptions NSMapTableStrongMemory = NSPointerFunctionsStrongMemory;
static const NSPointerFunctionsOptions NSMapTableWeakMemory = NSPointerFunctionsWeakMemory;
static const NSPointerFunctionsOptions NSMapTableZeroingWeakMemory = NSPointerFunctionsZeroingWeakMemory;
static const NSUInteger NSUndoCloseGroupingRunLoopOrdering = 350000;
static const PHAssetResourceDataRequestID PHInvalidAssetResourceDataRequestID = 0;
static const PHImageRequestID PHInvalidImageRequestID = 0;
static const UILayoutPriority UILayoutPriorityDefaultHigh = 750;
static const UILayoutPriority UILayoutPriorityDefaultLow = 250;
static const UILayoutPriority UILayoutPriorityFittingSizeLevel = 50;
static const UILayoutPriority UILayoutPriorityRequired = 1000; |
@jasssonpet very good regex skills, your list is missing only 2 constants ;) |
Are these in |
Yes, the constants are |
Fixed: #329 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
All compile time constants are exposed as variables and we are trying to retrive their values at runtime. This crashes the runtime because these variables doesn't exist at runtime. Example of such variable is
NSNotFound
in iOS 9:A possible solution is in metadata generation process to retrieve the value of the variable and save it as
JSCodeMeta
. This way we will no longer search for non-existing values at runtime.It can be tricky to handle all variable types e.g. numerics, string, char, structs etc.
The text was updated successfully, but these errors were encountered: