-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
[BUG] "typeof window" can not be the define key. #1954
Comments
@Amour1688 I think currently we can only use Input: if (typeof window === 'undefined') {
console.log('sss')
} else {
console.log('ttt')
}
console.log(window)
if (true) {
console.log("sss");
} else {
console.log("ttt");
}
console.log(void 0);
if (false) {
console.log("sss");
} else {
console.log("ttt");
}
console.log("object"); However this will change the value of |
This is not a bug. The define feature is only for replacing certain kinds of expressions. It's not a general-purpose code replacement mechanism. Changing just |
Closing this issue because this is not a bug, and I don't think this feature request should be implemented because it leads to logical inconsistencies in the code that could introduce bugs and/or be confusing. |
The text was updated successfully, but these errors were encountered: