SelectorMut WASM 적용

This commit is contained in:
freestrings
2019-06-10 18:16:08 +09:00
parent 24d18efb6f
commit ec5d76d2d6
7 changed files with 697 additions and 313 deletions

View File

@ -1,10 +1,10 @@
use std::collections::HashSet;
use array_tool::vec::{Intersect, Union};
use indexmap::IndexSet;
use serde_json::{Number, Value};
use parser::parser::*;
use indexmap::IndexSet;
fn to_f64(n: &Number) -> f64 {
if n.is_i64() {
@ -1088,10 +1088,14 @@ impl SelectorMut {
let target_opt = match *target_once {
Value::Object(ref mut map) => {
if is_last {
if let Some(v) = map.remove(token) {
map.insert(token.clone(), fun(&v));
let v = if let Some(v) = map.get(token) {
fun(v)
} else {
return;
}
};
map.insert(token.clone(), v);
return;
}
map.get_mut(token)
}