-
I was writing a how-to on using a new Sinon feature for auto-cleanup of stubs injected using accessors when I discovered it did not work when I exposed accessors on an exported object called 'mock'. You can see the full diff here: fatso83/sinon-swc-bug@eace1a7 Basically, if I write something like this: export const mock = {
get toBeMocked(){ return toBeMocked; },
set toBeMocked(mock){ toBeMocked = mock; }
} it will be transpiled to this by SWC (very different from export const _$mock = {
get toBeMocked(){ return toBeMocked; },
set toBeMocked(mock){ toBeMocked = mock; }
} Somehow 'mock' gets turned into |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 7 replies
-
It's because |
Beta Was this translation helpful? Give feedback.
Reported as #8148. It is actually ES5 as the target that will trigger the issue. Easy to see on the playground