From 148d1e4445d4ede6f6606a2418162458b1b01984 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Minh=20Nguye=CC=82=CC=83n?= Date: Mon, 14 May 2018 12:18:13 -0700 Subject: [PATCH] =?UTF-8?q?[core]=20Convert=20null=20to=20empty=20string,?= =?UTF-8?q?=20not=20=E2=80=9Cnull=E2=80=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- mapbox-gl-js | 2 +- platform/android/CHANGELOG.md | 3 +++ platform/ios/CHANGELOG.md | 2 +- platform/macos/CHANGELOG.md | 1 + src/mbgl/style/expression/compound_expression.cpp | 1 + 5 files changed, 7 insertions(+), 2 deletions(-) diff --git a/mapbox-gl-js b/mapbox-gl-js index 6b96d69ab54..cc3bb6afac7 160000 --- a/mapbox-gl-js +++ b/mapbox-gl-js @@ -1 +1 @@ -Subproject commit 6b96d69ab54b149db1f6ef06daed37379ac07447 +Subproject commit cc3bb6afac758258a559e6ab3f7c22d99f41b3bb diff --git a/platform/android/CHANGELOG.md b/platform/android/CHANGELOG.md index 384dcdf883a..6da01aacf32 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 7bf8f17389e..99da024ee1e 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 1ae0212b977..89ef484ca65 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 3bd8a836df8..4739d501688 100644 --- a/src/mbgl/style/expression/compound_expression.cpp +++ b/src/mbgl/style/expression/compound_expression.cpp @@ -303,6 +303,7 @@ std::unordered_map initiali define("to-string", [](const Value& value) -> Result { return value.match( + [](const NullValue&) -> Result { return std::string(); }, [](const Color& c) -> Result { return c.stringify(); }, // avoid quoting [](const std::string& s) -> Result { return s; }, // avoid quoting [](const auto& v) -> Result { return stringify(v); }