(value: Value)
| 317 | ); |
| 318 | } |
| 319 | } |
| 320 | } |
| 321 | |
| 322 | if let Some(string) = get_coerced_string(&value) { |
| 323 | return Buffer::from_string_encoding(&ctx, string, encoding)?.into_js(&ctx); |
| 324 | } |
| 325 | |
| 326 | Err(Exception::throw_message( |
| 327 | &ctx, |
| 328 | "value must be typed DataView, Buffer, ArrayBuffer, Uint8Array or interpretable as string", |
| 329 | )) |