mirror of
https://github.com/less/less.js.git
synced 2026-04-09 03:00:20 -04:00
Fixes "function" test against regular expressions
In some browser engines (especially older versions of Webkit), this test fails when the argument is a RegExp. See: http://stackoverflow.com/questions/5054352/why-use-typeof-for-identifyin g-a-function Fix tested and works with Adobe AIR.
This commit is contained in:
@@ -224,7 +224,7 @@ less.Parser = function Parser(env) {
|
||||
}
|
||||
|
||||
function expect(arg, msg) {
|
||||
var result = (typeof arg === "function") ? arg.call(parsers) : $(arg);
|
||||
var result = (Object.prototype.toString.call(arg) === '[object Function]') ? arg.call(parsers) : $(arg);
|
||||
if (result) {
|
||||
return result;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user