[core] Convert null to empty string, not “null”
This commit is contained in:
committed by
Minh Nguyễn
parent
0d067e3925
commit
4b1530ff42
Submodule mapbox-gl-js updated: 6b96d69ab5...cc3bb6afac
@@ -2,6 +2,9 @@
|
||||
|
||||
Mapbox welcomes participation and contributions from everyone. If you'd like to do so please see the [`Contributing Guide`](https://github.com/mapbox/mapbox-gl-native/blob/master/CONTRIBUTING.md) first to get started.
|
||||
|
||||
## 6.1.2
|
||||
- `"to-string"` expression operator converts `null` to empty string rather than to `"null"` [#11904](https://github.com/mapbox/mapbox-gl-native/pull/11904)
|
||||
|
||||
## 6.1.1 - May 7, 2018
|
||||
- Update telemetry to 3.1.0 [#11855](https://github.com/mapbox/mapbox-gl-native/pull/11855)
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@ Mapbox welcomes participation and contributions from everyone. Please read [CONT
|
||||
|
||||
* Deprecated `+[NSExpression featurePropertiesVariableExpression]` use `+[NSExpression featureAttributesVariableExpression]` instead. ([#11748](https://github.com/mapbox/mapbox-gl-native/pull/11748))
|
||||
* Added `FIRST`, `LAST`, and `SIZE` symbolic array subscripting support to expressions. ([#11770](https://github.com/mapbox/mapbox-gl-native/pull/11770))
|
||||
|
||||
* Inside an expression, casting `nil` to a string turns it into the empty string instead of the string `"null"`. ([#11904](https://github.com/mapbox/mapbox-gl-native/pull/11904))
|
||||
|
||||
### Annotations
|
||||
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
* Deprecated `+[NSExpression featurePropertiesVariableExpression]` use `+[NSExpression featureAttributesVariableExpression]` instead. ([#11748](https://github.com/mapbox/mapbox-gl-native/pull/11748))
|
||||
* Added `-[NSPredicate(MGLAdditions) predicateWithMGLJSONObject:]` method and `NSPredicate.mgl_jsonExpressionObject` property. ([#11810](https://github.com/mapbox/mapbox-gl-native/pull/11810))
|
||||
* Added `FISRT`, `LAST`, and `SIZE` symbolic array subscripting support to expressions. ([#11770](https://github.com/mapbox/mapbox-gl-native/pull/11770))
|
||||
* Inside an expression, casting `nil` to a string turns it into the empty string instead of the string `"null"`. ([#11904](https://github.com/mapbox/mapbox-gl-native/pull/11904))
|
||||
|
||||
### Other changes
|
||||
|
||||
|
||||
@@ -303,6 +303,7 @@ std::unordered_map<std::string, CompoundExpressionRegistry::Definition> initiali
|
||||
|
||||
define("to-string", [](const Value& value) -> Result<std::string> {
|
||||
return value.match(
|
||||
[](const NullValue&) -> Result<std::string> { return std::string(); },
|
||||
[](const Color& c) -> Result<std::string> { return c.stringify(); }, // avoid quoting
|
||||
[](const std::string& s) -> Result<std::string> { return s; }, // avoid quoting
|
||||
[](const auto& v) -> Result<std::string> { return stringify(v); }
|
||||
|
||||
Reference in New Issue
Block a user