Skip to content

Commit 064bd1a

Browse files
author
Guy Bedford
authored
gen-host-js: Fix typo in ComponentError constructor, -b short flag (#429)
1 parent aed92eb commit 064bd1a

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

crates/gen-host-js/src/lib.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ pub struct Opts {
7878
pub no_nodejs_compat: bool,
7979
/// Set the cutoff byte size for base64 inlining core Wasm in instantiation mode
8080
/// (set to 0 to disable all base64 inlining)
81-
#[cfg_attr(feature = "clap", arg(long, default_value_t = 5000))]
81+
#[cfg_attr(feature = "clap", arg(long, short = 'b', default_value_t = 5000))]
8282
pub base64_cutoff: usize,
8383
/// Enables compatibility for JS environments without top-level await support
8484
/// via an async $init promise export to wait for instead.
@@ -574,8 +574,8 @@ impl Js {
574574
Intrinsic::ComponentError => self.src.js_intrinsics("
575575
class ComponentError extends Error {
576576
constructor (value) {
577-
const enumerable = typeof payload !== 'string';
578-
super(`${String(value)}${enumerable ? ' (see error.payload)' : ''}`);
577+
const enumerable = typeof value !== 'string';
578+
super(enumerable ? `${String(value)} (see error.payload)` : value);
579579
Object.defineProperty(this, 'payload', { value, enumerable });
580580
}
581581
}

0 commit comments

Comments
 (0)