summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMinh Nguyễn <mxn@1ec5.org>2018-05-14 12:18:13 -0700
committerMinh Nguyễn <mxn@1ec5.org>2018-05-14 13:24:42 -0700
commit4b1530ff422d9ba77ddb9ef34d64c2e04f356380 (patch)
treec9b1ae32ca0257d485eec258492f2cc40cb650ed
parent0d067e39253813b07c421a1c0a21c57a775fd8ec (diff)
downloadqtlocation-mapboxgl-4b1530ff422d9ba77ddb9ef34d64c2e04f356380.tar.gz
[core] Convert null to empty string, not “null”
m---------mapbox-gl-js0
-rw-r--r--platform/android/CHANGELOG.md3
-rw-r--r--platform/ios/CHANGELOG.md2
-rw-r--r--platform/macos/CHANGELOG.md1
-rw-r--r--src/mbgl/style/expression/compound_expression.cpp1
5 files changed, 6 insertions, 1 deletions
diff --git a/mapbox-gl-js b/mapbox-gl-js
-Subproject 6b96d69ab54b149db1f6ef06daed37379ac0744
+Subproject cc3bb6afac758258a559e6ab3f7c22d99f41b3b
diff --git a/platform/android/CHANGELOG.md b/platform/android/CHANGELOG.md
index 384dcdf883..6da01aacf3 100644
--- a/platform/android/CHANGELOG.md
+++ b/platform/android/CHANGELOG.md
@@ -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)
diff --git a/platform/ios/CHANGELOG.md b/platform/ios/CHANGELOG.md
index 7bf8f17389..99da024ee1 100644
--- a/platform/ios/CHANGELOG.md
+++ b/platform/ios/CHANGELOG.md
@@ -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
diff --git a/platform/macos/CHANGELOG.md b/platform/macos/CHANGELOG.md
index 1ae0212b97..89ef484ca6 100644
--- a/platform/macos/CHANGELOG.md
+++ b/platform/macos/CHANGELOG.md
@@ -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
diff --git a/src/mbgl/style/expression/compound_expression.cpp b/src/mbgl/style/expression/compound_expression.cpp
index 3bd8a836df..4739d50168 100644
--- a/src/mbgl/style/expression/compound_expression.cpp
+++ b/src/mbgl/style/expression/compound_expression.cpp
@@ -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); }