The part of code with problem : (when i remove this code, minify is OK)
`var requirementConverters = {
string: function string(_string) {
return _string;
},
integer: function integer(string) {
if (isNaN(string)) throw 'Requirement is not an integer: "' + string + '"';
return parseInt(string, 10);
},
number: function number(string) {
if (isNaN(string)) throw 'Requirement is not a number: "' + string + '"';
return parseFloat(string);
},
reference: function reference(string) {
// Unused for now
var result = $(string);
if (result.length === 0) throw 'No such reference: "' + string + '"';
return result;
},
boolean: function boolean(string) {
return string !== 'false';
},
object: function object(string) {
return ParsleyUtils__default.deserializeValue(string);
},
regexp: function regexp(_regexp) {
var flags = '';
// Test if RegExp is literal, if not, nothing to be done, otherwise, we need to isolate flags and pattern
if (/^\/.*\/(?:[gimy]*)$/.test(_regexp)) {
// Replace the regexp literal string with the first match group: ([gimy]*)
// If no flag is present, this will be a blank string
flags = _regexp.replace(/.*\/([gimy]*)$/, '$1');
// Again, replace the regexp literal string with the first match group:
// everything excluding the opening and closing slashes and the flags
_regexp = _regexp.replace(new RegExp('^/(.*?)/' + flags + '$'), '$1');
} else {
// Anchor regexp:
_regexp = '^' + _regexp + '$';
}
return new RegExp(_regexp, flags);
}
};`
This bug is already announced and in processing? What is the best workaround?
Impossible to minify Parsely.js Source (non-minified) with YUI Compressor. Other related post, same problem with Rhino https://github.com/guillaumepotier/Parsley.js/issues/1070
The part of code with problem : (when i remove this code, minify is OK)
`var requirementConverters = { string: function string(_string) { return _string; }, integer: function integer(string) { if (isNaN(string)) throw 'Requirement is not an integer: "' + string + '"'; return parseInt(string, 10); }, number: function number(string) { if (isNaN(string)) throw 'Requirement is not a number: "' + string + '"'; return parseFloat(string); }, reference: function reference(string) { // Unused for now var result = $(string); if (result.length === 0) throw 'No such reference: "' + string + '"'; return result; }, boolean: function boolean(string) { return string !== 'false'; }, object: function object(string) { return ParsleyUtils__default.deserializeValue(string); }, regexp: function regexp(_regexp) { var flags = '';
This bug is already announced and in processing? What is the best workaround?