We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Great library, love the amount of effort you guys have put in.
I was checking out src/js/utils/events.js.
once: function (el, type, callback) { var typeArray = type.split(' '); for (var i = typeArray.length - 1; i >= 0; i--) { el.addEventListener(typeArray[i], function(e) { e.target.removeEventListener(e.type, arguments.callee); return callback(e); }); }; }
MDN warns that arguments.callee is forbidden in strict mode here.
arguments.callee
Would a solution as below be a better option? Thanks!
module.exports = { once: function(el, type, callback) { var typeArray = type.split(' '); var recursiveFunction = function(e){ e.target.removeEventListener(e.type, recursiveFunction); return callback(e); }; for(var i = typeArray.length - 1; i > 0; i--) { on(el, typeArray[i], recursiveFunction); } }, // IE8+ Support on: function(el, type, callback) { if(el.addEventListener) { el.addEventListener(type, callback); } else { el.attachEvent('on' + type, function() { callback.call(el); }); } }, // IE8+ Support off: function(el, type, callback) { if(el.removeEventListener) { el.removeEventListener(type, callback); } else { el.detachEvent('on' + type, callback); } } };
The text was updated successfully, but these errors were encountered:
@choonkending Thanks for catching this. Would you like to submit a PR?
Sorry, something went wrong.
@hai-cea Sure would! Will submit a PR soon.
Merge pull request #185 from choonkending/fix_deprecated_arguments
dc381c3
#169 arguments.callee is deprecated in strict mode for ecma 5
This was fixed with #185
createTheme
No branches or pull requests
Great library, love the amount of effort you guys have put in.
I was checking out src/js/utils/events.js.
MDN warns that
arguments.callee
is forbidden in strict mode here.Would a solution as below be a better option? Thanks!
The text was updated successfully, but these errors were encountered: