[core] Make "to-number" of null behave as documented

This commit is contained in:
John Firebaugh
2018-09-13 10:14:31 -07:00
parent b64b4cd1f7
commit 20adb486f7
3 changed files with 3 additions and 1 deletions

View File

@@ -112,6 +112,7 @@
"render-tests/regressions/mapbox-gl-js#6655": "skip - port https://github.com/mapbox/mapbox-gl-js/pull/6263 - needs issue",
"render-tests/regressions/mapbox-gl-js#6706": "https://github.com/mapbox/mapbox-gl-native/issues/10619",
"render-tests/regressions/mapbox-gl-js#6806": "pending https://github.com/mapbox/mapbox-gl-js/pull/6812",
"render-tests/regressions/mapbox-gl-js#7271": "https://github.com/mapbox/mapbox-gl-native/issues/12888",
"render-tests/regressions/mapbox-gl-native#7357": "https://github.com/mapbox/mapbox-gl-native/issues/7357",
"render-tests/runtime-styling/image-add-sdf": "https://github.com/mapbox/mapbox-gl-native/issues/9847",
"render-tests/runtime-styling/paint-property-fill-flat-to-extrude": "https://github.com/mapbox/mapbox-gl-native/issues/6745",

View File

@@ -10,6 +10,7 @@ namespace expression {
EvaluationResult toNumber(const Value& v) {
optional<double> result = v.match(
[](NullValue) -> optional<double> { return 0.0; },
[](const double f) -> optional<double> { return f; },
[](const std::string& s) -> optional<double> {
try {