diff --git a/crates/cli-support/src/js/mod.rs b/crates/cli-support/src/js/mod.rs index f67236599..e1e9d8a35 100644 --- a/crates/cli-support/src/js/mod.rs +++ b/crates/cli-support/src/js/mod.rs @@ -1817,8 +1817,9 @@ impl<'a, 'b> SubContext<'a, 'b> { if import.structural { format!( "function() {{ - return this.{}; + return {}.{}; }}", + if is_static { &class } else { "this" }, g ) } else { @@ -1835,8 +1836,9 @@ impl<'a, 'b> SubContext<'a, 'b> { if import.structural { format!( "function(y) {{ - this.{} = y; + {}.{} = y; }}", + if is_static { &class } else { "this" }, s ) } else {