Skip to content

Commit

Permalink
chore(npm): update grunt-jscs to 1.2.0 (jscs to 1.10.0), fix styles
Browse files Browse the repository at this point in the history
  • Loading branch information
petebacondarwin committed Jan 30, 2015
1 parent c1500ea commit 29ad3b7
Show file tree
Hide file tree
Showing 8 changed files with 69 additions and 45 deletions.
3 changes: 1 addition & 2 deletions .jscs.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,5 @@
"requireSpacesInFunction": {
"beforeOpeningCurlyBrace": true
},
"validateLineBreaks": "LF",
"validateParameterSeparator": ", "
"validateLineBreaks": "LF"
}
1 change: 1 addition & 0 deletions .jscs.json.todo
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
// that correct the existing code base issues and make the new check pass.

{
"validateParameterSeparator": ", ", // Re-assert this rule when JSCS allows multiple spaces
"requireCurlyBraces": ["if", "else", "for", "while", "do", "try", "catch"],
"disallowImplicitTypeConversion": ["string"],
"disallowMultipleLineBreaks": true,
Expand Down
84 changes: 54 additions & 30 deletions npm-shrinkwrap.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"grunt-contrib-jshint": "~0.10.0",
"grunt-ddescribe-iit": "~0.0.1",
"grunt-jasmine-node": "git://github.com/vojtajina/grunt-jasmine-node.git#fix-grunt-exit-code",
"grunt-jscs": "~0.7.1",
"grunt-jscs": "~1.2.0",
"grunt-merge-conflict": "~0.0.1",
"grunt-shell": "~1.1.1",
"gulp": "~3.8.0",
Expand Down
2 changes: 1 addition & 1 deletion src/Angular.js
Original file line number Diff line number Diff line change
Expand Up @@ -628,7 +628,7 @@ function isElement(node) {
function makeMap(str) {
var obj = {}, items = str.split(","), i;
for (i = 0; i < items.length; i++)
obj[ items[i] ] = true;
obj[items[i]] = true;
return obj;
}

Expand Down
16 changes: 8 additions & 8 deletions src/ngSanitize/sanitize.js
Original file line number Diff line number Diff line change
Expand Up @@ -271,14 +271,14 @@ function htmlParser(html, handler) {
}
}
var index, chars, match, stack = [], last = html, text;
stack.last = function() { return stack[ stack.length - 1 ]; };
stack.last = function() { return stack[stack.length - 1]; };

while (html) {
text = '';
chars = true;

// Make sure we're not in a script or style element
if (!stack.last() || !specialElements[ stack.last() ]) {
if (!stack.last() || !specialElements[stack.last()]) {

// Comment
if (html.indexOf("<!--") === 0) {
Expand Down Expand Up @@ -360,17 +360,17 @@ function htmlParser(html, handler) {

function parseStartTag(tag, tagName, rest, unary) {
tagName = angular.lowercase(tagName);
if (blockElements[ tagName ]) {
while (stack.last() && inlineElements[ stack.last() ]) {
if (blockElements[tagName]) {
while (stack.last() && inlineElements[stack.last()]) {
parseEndTag("", stack.last());
}
}

if (optionalEndTagElements[ tagName ] && stack.last() == tagName) {
if (optionalEndTagElements[tagName] && stack.last() == tagName) {
parseEndTag("", tagName);
}

unary = voidElements[ tagName ] || !!unary;
unary = voidElements[tagName] || !!unary;

if (!unary)
stack.push(tagName);
Expand All @@ -395,13 +395,13 @@ function htmlParser(html, handler) {
if (tagName)
// Find the closest opened tag of the same type
for (pos = stack.length - 1; pos >= 0; pos--)
if (stack[ pos ] == tagName)
if (stack[pos] == tagName)
break;

if (pos >= 0) {
// Close all the open elements, up the stack
for (i = stack.length - 1; i >= pos; i--)
if (handler.end) handler.end(stack[ i ]);
if (handler.end) handler.end(stack[i]);

// Remove the open elements from the stack
stack.length = pos;
Expand Down
2 changes: 1 addition & 1 deletion test/ng/compileSpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -6347,7 +6347,7 @@ describe('$compile', function() {
link: function(scope, element, attrs, ctrl, transclude) {

// We use timeout here to simulate how ng-if works
$timeout(function() {
$timeout(function() {
transclude(function(child) { element.append(child); });
});
}
Expand Down
4 changes: 2 additions & 2 deletions test/ng/directive/inputSpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -1641,9 +1641,9 @@ describe('input', function() {
});
});

describe('max', function() {
describe('max', function() {

it('should invalidate', function() {
it('should invalidate', function() {
var inputElm = helper.compileInput('<input type="date" ng-model="value" name="alias" max="2019-01-01" />');
helper.changeInputValueTo('2019-12-31');
expect(inputElm).toBeInvalid();
Expand Down

0 comments on commit 29ad3b7

Please sign in to comment.