Transition to new literals compiling.
Tests still need work, as does the implementation for json.
This commit is contained in:
@@ -2,6 +2,7 @@ extern crate nom;
|
||||
|
||||
use crate::renderer::CompareContextElement;
|
||||
use parser::Filter;
|
||||
use parser::OwnedLiteral;
|
||||
use renderer::compile_template;
|
||||
use renderer::CompiledTemplate;
|
||||
use renderer::ContextElement;
|
||||
@@ -169,13 +170,13 @@ impl CompareContextElement for serde_json::Value {
|
||||
}
|
||||
|
||||
fn partial_compare(&self, other: &dyn ContextElement) -> Option<Ordering> {
|
||||
println!("partial_compare json {:?} | {:?}", self, other);
|
||||
// println!("partial_compare json {:?} | {:?}", self, other);
|
||||
// Handle type coerced objects
|
||||
|
||||
// When doing a greater than or less than comparison,
|
||||
// javascript coerces objects into "[object Object]".
|
||||
if let serde_json::Value::Object(_) = self {
|
||||
return "[object Object]".to_owned().partial_compare(other);
|
||||
return OwnedLiteral::LString("[object Object]".to_owned()).partial_compare(other);
|
||||
}
|
||||
|
||||
// Handle other serde_json::Value
|
||||
|
||||
Reference in New Issue
Block a user