Avoid enforcing strict mode in _.defaults, _.extend, and _.bindAll and add benchmarks for _.bindAll and _.functions. [closes #45]

Former-commit-id: 1bb0b5155d3ae46052b4a06cb538dff307e8ec5e
This commit is contained in:
John-David Dalton
2012-07-12 15:25:18 -04:00
parent 9530efb4d4
commit 3386c2a7a5
6 changed files with 137 additions and 63 deletions

View File

@@ -223,13 +223,13 @@
'inLoop',
'init',
'isKeysFast',
'iteratee',
'object',
'objectBranch',
'noCharByIndex',
'shadowed',
'top',
'useHas'
'useHas',
'useStrict'
];
/** Collections of method names */
@@ -840,13 +840,7 @@
// prepend data object references to property names to avoid having to
// use a with-statement
iteratorOptions.forEach(function(property) {
if (property == 'iteratee') {
// use a more fine-grained regexp for the `iteratee` property because
// it's a compiled variable as well as a data property
snippet = snippet.replace(/(__t *= *\( *)(iteratee)/, '$1obj.$2');
} else {
snippet = snippet.replace(RegExp('([^\\w.])\\b' + property + '\\b', 'g'), '$1obj.' + property);
}
snippet = snippet.replace(RegExp('([^\\w.])\\b' + property + '\\b', 'g'), '$1obj.' + property);
});
// remove unnecessary code