Use Date.now in modern builds.

Former-commit-id: de4329c5f4eaa92da8447e1232ce28e00a0f885d
This commit is contained in:
John-David Dalton
2013-08-09 08:22:38 -07:00
parent 690e5a7f9c
commit 44c10d720a
9 changed files with 72 additions and 64 deletions

View File

@@ -3106,7 +3106,7 @@
source = removeSupportProp(source, 'fastBind');
source = replaceSupportProp(source, 'argsClass', 'false');
// remove native `Function#bind` branch in `_.bind`
// remove native `Function#bind` branch in `createBound`
source = source.replace(matchFunction(source, 'createBound'), function(match) {
return match.replace(/(?:\s*\/\/.*)*\n( *)if *\([^{]+?nativeBind[\s\S]+?\n\1else *\{([\s\S]+?)\n\1}/, function(match, indent, snippet) {
return snippet
@@ -3171,6 +3171,11 @@
return match.replace(/(?: *\/\/.*\n)*( *return ai[^:]+:).+/, '$1 1;');
});
// replace `+new Date` with `Date.now` use in `_.debounce
source = source.replace(matchFunction(source, 'debounce'), function(match) {
return match.replace(/\+new Date\b/g, 'now()');
});
// remove `shimIsPlainObject` from `_.isPlainObject`
source = source.replace(matchFunction(source, 'isPlainObject'), function(match) {
return match.replace(/!getPrototypeOf[^:]+:\s*/, '');