Remove debug and tweak template whitespace for pretty printing.

Former-commit-id: 1f00899af1210dd367718aad4db38453509747c2
This commit is contained in:
John-David Dalton
2012-05-08 17:34:13 -04:00
parent ccbf965bd9
commit 98435d2d92
2 changed files with 15 additions and 17 deletions

View File

@@ -113,21 +113,21 @@
// the following branch is for iterating arrays and array-like objects
'<% if (arrayBranch) { %>' +
' var length = <%= firstArg %>.length; index = -1;' +
' <% if (objectBranch) { %>\n if (length === +length) {\n<% } %>' +
'var length = <%= firstArg %>.length; index = -1;' +
' <% if (objectBranch) { %>\nif (length === +length) {\n<% } %>' +
' <%= arrayBranch.beforeLoop %>;\n' +
' while (<%= arrayBranch.loopExp %>) {\n' +
' <%= arrayBranch.inLoop %>;\n' +
' }' +
' <% if (objectBranch) { %>\n }\n<% }' +
' <% if (objectBranch) { %>\n}\n<% }' +
'}' +
// the following branch is for iterating an object's own/inherited properties
'if (objectBranch) {' +
' if (arrayBranch) { %> else {\n<% }' +
' if (!hasDontEnumBug) { %> var skipProto = typeof <%= iteratedObject %> == \'function\';\n<% } %>' +
' if (arrayBranch) { %>else {\n<% }' +
' if (!hasDontEnumBug) { %> var skipProto = typeof <%= iteratedObject %> == \'function\';\n<% } %>' +
' <%= objectBranch.beforeLoop %>;\n' +
' for (<%= objectBranch.loopExp %>) {\n' +
' for (<%= objectBranch.loopExp %>) {' +
' <%' +
' if (hasDontEnumBug) {' +
' if (useHas) { %> if (<%= hasExp %>) {\n <% } %>' +
@@ -135,7 +135,7 @@
' if (useHas) { %> }\n<% }' +
' }' +
' else {' +
' %>' +
' %>\n' +
// Firefox < 3.6, Opera > 9.50 - Opera < 11.60, and Safari < 5.1
// (if the prototype or a property on the prototype has been set)
@@ -143,12 +143,11 @@
// value to true. Because of this Lo-Dash standardizes on skipping
// the the `prototype` property of functions regardless of its
// [[Enumerable]] value.
' if (!(skipProto && index == "prototype")' +
' <% if (useHas) { %>\n && <%= hasExp %><% } %>) {\n' +
' if (!(skipProto && index == "prototype")<% if (useHas) { %> && <%= hasExp %><% } %>) {\n' +
' <%= objectBranch.inLoop %>;\n' +
' }' +
' <% } %>' +
' }\n' +
' <% } %>\n' +
' }' +
// Because IE < 9 can't set the `[[Enumerable]]` attribute of an
// existing property and the `constructor` property of a prototype
@@ -159,15 +158,14 @@
' skipCtor = ctor && ctor.prototype === <%= iteratedObject %>;\n' +
' for (var j = 0; j < 7; j++) {\n' +
' index = shadowed[j];\n' +
' if (!(skipCtor && index == "constructor") &&\n' +
' <%= hasExp %>) {\n' +
' if (!(skipCtor && index == "constructor") && <%= hasExp %>) {\n' +
' <%= objectBranch.inLoop %>;\n' +
' }\n' +
' }\n' +
' }' +
'<% }' +
' if (arrayBranch) { %>\n }\n<% }' +
'} %>' +
' if (arrayBranch) { %>\n}<% }' +
'} %>\n' +
// add code to the bottom of the iteration function
'<%= bottom %>;\n' +

View File

@@ -151,7 +151,7 @@
Foo.a = 1;
Foo.b = 2;
var expected = { 'a': 1, 'b': 2 }; console.log(_.keys(_.extend({}, Foo)))
var expected = { 'a': 1, 'b': 2 };
deepEqual(_.extend({}, Foo), expected);
Foo.prototype = { 'c': 3 };