-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Open
Labels
Description
Describe the bug
The in operator triggers the has trap when used with a Proxy. Because of this, it must not be removed or replaced during minification, as doing so can change the program’s behavior.
Input code
const TRACK_MEMO_SYMBOL = Symbol();
const obj = new Proxy({}, {
has: (target, p) => {
if(p === TRACK_MEMO_SYMBOL) {
console.log('sideEffect')
}
return target[p]
}
})
TRACK_MEMO_SYMBOL in obj;Config
Link to the code that reproduces this issue
SWC Info output
No response
Expected behavior
Expression shouldn't be removed
Actual behavior
expression TRACK_MEMO_SYMBOL in obj; removed
No response
Version
1.3.5, 1.15.0
Additional context
No response