[core] Implement Expression::serialize()

Issue #10714
- Each expression stores its operator as a string, and default serialization is [operator, serialize(child1), ...]
- Custom implementations of `serialize` for Expression types that don't follow the pattern
- expression::Value -> mbgl::Value converter
- node_expression bindings to expose `serialize`
This commit is contained in:
Chris Loer
2018-02-08 15:23:29 -08:00
committed by Chris Loer
parent 341eb7645f
commit 8635dab4c3
30 changed files with 262 additions and 40 deletions

View File

@@ -32,6 +32,9 @@ private:
static void GetType(const Nan::FunctionCallbackInfo<v8::Value>&);
static void IsFeatureConstant(const Nan::FunctionCallbackInfo<v8::Value>&);
static void IsZoomConstant(const Nan::FunctionCallbackInfo<v8::Value>&);
static void Serialize(const Nan::FunctionCallbackInfo<v8::Value>&);
static Nan::Persistent<v8::Function> constructor;
std::unique_ptr<Expression> expression;