简体   繁体   中英

Google Closure compiler warning for RegExp

When compiling a Javascript file using the Google Closure compiler set for Advanced Optimization, I get the following warning:

WARNING - References to the global RegExp object prevents optimization of regular expressions.

The warning is being triggered by the following line of code, which I believe is fine.

        rv = parseFloat( RegExp.$1 );

What keyword can I use in a Suppress construct of the following form for suppressing the aforementioned warning:

/** @suppress {need_keyword_here} */

/** @suppress {checkRegExp} */ does the trick.

Source: this list of warnings

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM