In my Grunt/yeoman/angular project, I have part of the code written as node modules and imported by Grunt during the build project with browserify. it happens that, only on safari(checked on 7 and 8), the minified version of the webapp doesn't work because of this error:
SyntaxError: Cannot declare a parameter named 'k' in strict mode
I discovered that the line of code is this one:
c.prototype.key=function k(k){var a=this._baseState;return f(null===a.key),a.key=k,this}
And the starting code is:
Node.prototype.key = function key(key) {
var state = this._baseState;
assert(state.key === null);
state.key = key;
return this;
};
I don't understand if it is part of the browserify libraries, but surely it's included when I add mathjs to the project. I tried reserving the word "key" with uglifyJS mangle options, but "key" is a reserved word, too.
How can I avoid this kind of problems? Am I using the wrong approach?
EDIT: I found the function in asn1 lib https://github.com/indutny/asn1.js/blob/master/lib/asn1/base/node.js#L225 Now I don't really know how to go on.
EDIT: The author of the library has fixed the issue istantly :) https://github.com/indutny/asn1.js/commit/c75d861e705df9559bf572e682552278b98a218d