Skip to content

Commit

Permalink
fix(platform-declarations-ios): Change 2^64-1 enum values to -1
Browse files Browse the repository at this point in the history
`18446744073709551615` (`0xFFFFFFFFFFFFFFFF`) is an overflow to the JS
numerical system and therefore incorrect. Integer values from `-(2^53-1)` to `(2^53-1)`
only can be safely represented in JS (`Number​.MIN_SAFE_INTEGER` to
`Number​.MAX_SAFE_INTEGER`)

There's a fix in iOS Runtime's metadata generator which now automatically
converts such values to signed. (NativeScript/ios-jsc#1151)

refs NativeScript/ios-jsc#1150
  • Loading branch information
mbektchiev committed Jun 5, 2019
1 parent 1c22a73 commit 6720139
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -743,7 +743,7 @@ declare const enum MPMediaType {

AnyVideo = 65280,

Any = 18446744073709551615
Any = -1
}

declare class MPMovieAccessLog extends NSObject implements NSCopying {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,7 @@ declare const enum PKPassType {

Payment = 1,

Any = 18446744073709551615
Any = -1
}

declare class PKPayment extends NSObject {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2939,7 +2939,7 @@ declare const enum SCNPhysicsCollisionCategory {

Static = 2,

All = 18446744073709551615
All = -1
}

declare class SCNPhysicsConeTwistJoint extends SCNPhysicsBehavior {
Expand Down
8 changes: 4 additions & 4 deletions tns-platform-declarations/ios/objc-x86_64/objc!UIKit.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4354,7 +4354,7 @@ declare const enum UICollisionBehaviorMode {

Boundaries = 2,

Everything = 18446744073709551615
Everything = -1
}

declare class UIColor extends NSObject implements NSCopying, NSItemProviderReading, NSItemProviderWriting, NSSecureCoding {
Expand Down Expand Up @@ -4831,7 +4831,7 @@ declare const enum UIDataDetectorTypes {

None = 0,

All = 18446744073709551615
All = -1
}

interface UIDataSourceModelAssociation {
Expand Down Expand Up @@ -9348,7 +9348,7 @@ declare const enum UIPopoverArrowDirection {

Any = 15,

Unknown = 18446744073709551615
Unknown = -1
}

declare class UIPopoverBackgroundView extends UIView implements UIPopoverBackgroundViewMethods {
Expand Down Expand Up @@ -10286,7 +10286,7 @@ declare const enum UIRectCorner {

BottomRight = 8,

AllCorners = 18446744073709551615
AllCorners = -1
}

declare const enum UIRectEdge {
Expand Down
4 changes: 2 additions & 2 deletions tns-platform-declarations/ios/objc-x86_64/objc!WebKit.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ declare const enum WKAudiovisualMediaTypes {

Video = 2,

All = 18446744073709551615
All = -1
}

declare class WKBackForwardList extends NSObject {
Expand Down Expand Up @@ -88,7 +88,7 @@ declare const enum WKDataDetectorTypes {

LookupSuggestion = 64,

All = 18446744073709551615,
All = -1,

SpotlightSuggestion = 64
}
Expand Down

0 comments on commit 6720139

Please sign in to comment.