You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
throw new Error('\"{local_name}\" resource does not define a constructor');
}}
But the TypeScript definitions ignore that fact, and don't generate anything, which means that tsc will still consider it to contain a built-in constructor that can be called, so static analysis will fail to catch this error, producing bugs that only surface at runtime.
Instead, I suggest generating a private constructor(); in TypeScript definitions, so that can be prevented at build time.
The text was updated successfully, but these errors were encountered:
When a WIT resource doesn't define a constructor,
jco
generates a JS constructor by default, that just throws when called:jco/crates/js-component-bindgen/src/transpile_bindgen.rs
Lines 621 to 623 in fe90d2f
But the TypeScript definitions ignore that fact, and don't generate anything, which means that
tsc
will still consider it to contain a built-in constructor that can be called, so static analysis will fail to catch this error, producing bugs that only surface at runtime.Instead, I suggest generating a
private constructor();
in TypeScript definitions, so that can be prevented at build time.The text was updated successfully, but these errors were encountered: