Disable
The disable
directive allows you to disable a transformation in a specific block or statement.
/\sMSIE\s[6-9]\./.test(navigator.userAgent)
There is a global
modifier that can be used to disable
the transformation for the whole JavaScript file. This is useful when you want to disable a transformation in a specific JavaScript file but keep it enabled for other files in your JavaScript application.
function isSE () {
return /google|yahoo|bing/.test(document.domain);
}
function isOldIE () {
return /\sMSIE\s[6-9]\./.test(navigator.userAgent);
}
It also allows you to disable
transformation aliases (directive define
) and transformation targets (directive targets
).
function isSE () {
return /google|yahoo|bing/.test(document.domain);
}
You can also disable all transformations enabled so far in a statement or block, allowing you to clean up every selected transformation without having to enumerate them all.
"I will be targeted"
function foo () {
"I won't be targeted"
function bar () {
"I won't be targeted either"
}
"But I will be targeted"
}