Closed daviferreira closed 9 years ago
@daviferreira could we just avoid the use of use strict
?
We can enforce most of the structuring properties of strictness through a linter.
I think we could take use strict
out if it's causing trouble, or @daviferreira am happy to review your wrapper too if that solves the problem.
From what I understand, modern javascript engines are able to optimise certain code paths if they know a function is in strict mode, this may or may not be a major issue / benefit for classNames - unfortunately I'm not familiar enough with the inner workings to say for sure...
@JedWatson this is apparently true, however I'd prefer to see some benchmarks before we just assume.
I'm having this specific problem using
classNames
withwebpack
devtool
option set toeval
. It only happens on Chrome and when the console is not open. The issue is callingclassNames
inside theclassNames
function with the'use strict'
statement inside the function (https://github.com/JedWatson/classnames/blob/master/index.js#L22), this will cause aReferenceError
.See:
https://github.com/webpack/webpack/issues/417
Explanation:
https://github.com/ftlabs/fastclick/pull/270
I would be happy to submit a PR with a umd wrapper if you guys are ok with it :)
Thanks for the great lib!