mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-04 00:57:48 +00:00
Rework "strict" build option and fix typo in test-ui.js.
Former-commit-id: e06045546bea43bbe1fff78d6c948036ad98a88c
This commit is contained in:
@@ -574,9 +574,9 @@
|
||||
QUnit.module('strict modifier');
|
||||
|
||||
(function() {
|
||||
var object = Object.create(Object.prototype, {
|
||||
'a': { 'value': _.identify },
|
||||
'b': { 'value': null }
|
||||
var object = Object.freeze({
|
||||
'a': _.identity,
|
||||
'b': null
|
||||
});
|
||||
|
||||
['non-strict', 'strict'].forEach(function(strictMode, index) {
|
||||
@@ -589,20 +589,26 @@
|
||||
}
|
||||
build(commands, function(source, filePath) {
|
||||
var basename = path.basename(filePath, '.js'),
|
||||
context = createContext(),
|
||||
pass = !index;
|
||||
context = createContext();
|
||||
|
||||
vm.runInContext(source, context);
|
||||
var lodash = context._;
|
||||
|
||||
try {
|
||||
lodash.bindAll(object);
|
||||
lodash.extend(object, { 'a': 1 });
|
||||
lodash.defaults(object, { 'b': 2 });
|
||||
} catch(e) {
|
||||
pass = !!index;
|
||||
}
|
||||
equal(pass, true, basename);
|
||||
var actual = _.every([
|
||||
function() { lodash.bindAll(object); },
|
||||
function() { lodash.extend(object, { 'a': 1 }); },
|
||||
function() { lodash.defaults(object, { 'b': 2 }); }
|
||||
], function(fn) {
|
||||
var pass = !index;
|
||||
try {
|
||||
fn();
|
||||
} catch(e) {
|
||||
pass = !!index;
|
||||
}
|
||||
return pass;
|
||||
});
|
||||
|
||||
equal(actual, true, basename);
|
||||
start();
|
||||
});
|
||||
});
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
case 'lodash-prod': return 'lodash.min.js';
|
||||
case 'lodash-underscore': return 'lodash.underscore.min.js';
|
||||
case 'lodash-custom': return 'lodash.custom.min.js';
|
||||
case 'lodash-custom-debug': return 'lodash.custom'.js;
|
||||
case 'lodash-custom-debug': return 'lodash.custom.js';
|
||||
}
|
||||
return 'lodash.js';
|
||||
}());
|
||||
|
||||
Reference in New Issue
Block a user