(&self, ctx: Ctx<'js>, name: String)
| 91 | value: Value<'js>, |
| 92 | filename: Opt<String>, |
| 93 | ) -> Result<()> { |
| 94 | let entry = value_to_form_entry(&ctx, name, value, filename)?; |
| 95 | self.entries.borrow_mut().push(entry); |
| 96 | Ok(()) |
| 97 | } |
| 98 | |
| 99 | pub fn get(&self, ctx: Ctx<'js>, name: String) -> Result<Value<'js>> { |
| 100 | let value = self |
| 101 | .entries |
| 102 | .borrow() |
| 103 | .iter() |
| 104 | .find(|(k, _)| *k == name) |
| 105 | .map(|(_, v)| v.clone()); |
| 106 | match value { |
| 107 | Some(v) => v.into_js(&ctx), |
| 108 | None => Ok(Value::new_null(ctx)), |