Function
create_hash_object
(ctx: &Ctx<'js>, hash: &ShaAlgorithm)
Source from the content-addressed store, hash-verified
| 1095 | } |
| 1096 | |
| 1097 | fn create_hash_object<'js>(ctx: &Ctx<'js>, hash: &ShaAlgorithm) -> Result<Object<'js>> { |
| 1098 | let hash_obj = Object::new(ctx.clone())?; |
| 1099 | hash_obj.set(PredefinedAtom::Name, hash.as_str())?; |
| 1100 | Ok(hash_obj) |
| 1101 | } |
| 1102 | |
| 1103 | pub fn hash_mismatch_error<T>(ctx: &Ctx<'_>, hash: &ShaAlgorithm) -> Result<T> { |
| 1104 | Err(Exception::throw_message( |
Tested by
no test coverage detected