Reduce _.isEmpty and ensure dependencies are modified correctly for the lodash underscore build.

Former-commit-id: 23ff37da17578dfeafbabee4bcae100f4df68ed6
This commit is contained in:
John-David Dalton
2012-10-13 20:58:08 -07:00
parent 1e4283aad3
commit 3f79ed5d91
2 changed files with 56 additions and 12 deletions

View File

@@ -632,9 +632,11 @@
});
equal(last.value, 2, '_.each: ' + basename);
equal(lodash.isEmpty('moe'), false, '_.isEmpty: ' + basename);
var object = { 'fn': lodash.bind(function(x) { return this.x + x; }, { 'x': 1 }, 1) };
var object = { 'length': 0, 'splice': Array.prototype.splice };
equal(lodash.isEmpty(object), false, '_.isEmpty: ' + basename);
object = { 'fn': lodash.bind(function(x) { return this.x + x; }, { 'x': 1 }, 1) };
equal(object.fn(), 2, '_.bind: ' + basename);
ok(lodash.clone(array, true)[0] === array[0], '_.clone: ' + basename);
@@ -642,6 +644,31 @@
});
});
asyncTest('should not have any Lo-Dash-only methods', function() {
var start = _.after(2, _.once(QUnit.start));
build(['-s', 'underscore'], function(source, filePath) {
var basename = path.basename(filePath, '.js'),
context = createContext();
vm.runInContext(source, context);
var lodash = context._;
_.each([
'forIn',
'forOwn',
'isPlainObject',
'lateBind',
'merge',
'partial'
], function(methodName) {
equal(lodash[methodName], undefined, '_.' + methodName + ' exists: ' + basename);
});
start();
});
});
asyncTest('`lodash underscore include=partial`', function() {
var start = _.after(2, _.once(QUnit.start));