-
Notifications
You must be signed in to change notification settings - Fork 1.3k
[ios, macos] Fix keypath expressions, json object is parsed incorrectly for nested keypaths. #11959
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In addition to the issue below, a changelog entry should be added for this bug fix.
NSArray *expressionObject; | ||
for (NSString *pathComponent in self.keyPath.pathComponents.reverseObjectEnumerator) { | ||
NSMutableArray *expressionObject; | ||
NSArray *keyPath = [self.keyPath componentsSeparatedByString:@"."]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ooh, good catch – I was probably thinking of NSString.stringByDeletingPathExtension
here.
if (expressionObject) { | ||
expressionObject = @[@"get", pathComponent, expressionObject]; | ||
[expressionObject addObject:@[@"get", pathComponent]]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
map.box.gl
should become ["get", "gl", ["get", "box", ["get", "map"]]]
, not ["get", "gl", ["get", "box"], ["get", "map"]]
.
1f5809c
to
41fd7c8
Compare
platform/ios/CHANGELOG.md
Outdated
@@ -16,6 +16,7 @@ Mapbox welcomes participation and contributions from everyone. Please read [CONT | |||
|
|||
* Unknown tokens in URLs are now preserved, rather than replaced with an empty string. ([#11787](https://github.com/mapbox/mapbox-gl-native/issues/11787)) | |||
* Adjusted when and how the camera transition update and finish callbacks are called, fixing recursion bugs. ([#11614](https://github.com/mapbox/mapbox-gl-native/pull/11614)) | |||
* Fixed an issue preventing nested `keyPath` expressions get parsed accordingly to the spec. ([#11959](https://github.com/mapbox/mapbox-gl-native/pull/11959)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: replace keyPath
with “key path” so developers don’t think this issue was limited to the +[NSExpression expressionForKeyPath:]
initializer.
…ctly for nested keypaths.
41fd7c8
to
73cf88b
Compare
Added the |
Fixes #11874