Make _.escape match _.template's escape delimiter results for null and undefined values.

Former-commit-id: b6717c6debf3bc308cf12b778916f5a46dbb954d
This commit is contained in:
John-David Dalton
2012-06-11 22:37:54 -04:00
parent 1e2ef542e4
commit 3a698eb0ed
3 changed files with 9 additions and 4 deletions

View File

@@ -157,6 +157,11 @@
test('should not escape the "/" character', function() {
equal(_.escape('/'), '/');
});
test('should return empty string when passed `null` or `undefined`', function() {
equal(_.escape(null), '');
equal(_.escape(undefined), '');
});
}());
/*--------------------------------------------------------------------------*/