Skip to content
This repository was archived by the owner on May 29, 2019. It is now read-only.

Commit d5238c6

Browse files
author
Nathan Williams
committed
style: fix style and test errors
1 parent 8907241 commit d5238c6

File tree

2 files changed

+13
-9
lines changed

2 files changed

+13
-9
lines changed

Diff for: src/modal/modal.js

+3-2
Original file line numberDiff line numberDiff line change
@@ -391,7 +391,7 @@ angular.module('ui.bootstrap.modal', [])
391391
var promiseChain = null;
392392
$modal.getPromiseChain = function() {
393393
return promiseChain;
394-
}
394+
};
395395

396396
$modal.open = function (modalOptions) {
397397

@@ -428,7 +428,8 @@ angular.module('ui.bootstrap.modal', [])
428428
// Then switch to our own combined promise dependency (regardless of how the previous modal fared).
429429
// Then add to $modalStack and resolve opened.
430430
// Finally clean up the chain variable if no subsequent modal has overwritten it.
431-
var samePromise = promiseChain = $q.all([promiseChain])
431+
var samePromise;
432+
samePromise = promiseChain = $q.all([promiseChain])
432433
.then(function() { return templateAndResolvePromise; }, function() { return templateAndResolvePromise; })
433434
.then(function resolveSuccess(tplAndVars) {
434435

Diff for: src/modal/test/modal.spec.js

+10-7
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
describe('$modal', function () {
22
var $controllerProvider, $rootScope, $document, $compile, $templateCache, $timeout, $q;
3-
var $modal, $modalProvider;
3+
var $modal, $modalStack, $modalProvider;
44

55
var triggerKeyDown = function (element, keyCode) {
66
var e = $.Event('keydown');
@@ -16,14 +16,15 @@ describe('$modal', function () {
1616
$modalProvider = _$modalProvider_;
1717
}));
1818

19-
beforeEach(inject(function (_$rootScope_, _$document_, _$compile_, _$templateCache_, _$timeout_, _$q_, _$modal_) {
19+
beforeEach(inject(function (_$rootScope_, _$document_, _$compile_, _$templateCache_, _$timeout_, _$q_, _$modal_, _$modalStack_) {
2020
$rootScope = _$rootScope_;
2121
$document = _$document_;
2222
$compile = _$compile_;
2323
$templateCache = _$templateCache_;
2424
$timeout = _$timeout_;
2525
$q = _$q_;
2626
$modal = _$modal_;
27+
$modalStack = _$modalStack_;
2728
}));
2829

2930
beforeEach(function () {
@@ -796,12 +797,14 @@ describe('$modal', function () {
796797

797798
// Calls emit n! times on arrays of length n containing all non-repeating permutations of the integers 0..n-1.
798799
function permute(n, emit) {
799-
if (n < 1 || typeof emit !== 'function') return;
800+
if (n < 1 || typeof emit !== 'function') {
801+
return;
802+
}
800803
var a = [];
801804
function _permute(depth) {
802805
index: for (var i=0; i < n; i++) {
803806
for (var j=0; j < depth; j++) {
804-
if (a[j] == i) {
807+
if (a[j] === i) {
805808
continue index; // already used
806809
}
807810
}
@@ -819,11 +822,11 @@ describe('$modal', function () {
819822

820823
permute(2, function(a) { test(a); });
821824
permute(2, function(a) { test(a.map(function(x, i) { return {reject:x}; })); });
822-
permute(2, function(a) { test(a.map(function(x, i) { return i == 0 ? {reject:x} : x; })); });
825+
permute(2, function(a) { test(a.map(function(x, i) { return i === 0 ? {reject:x} : x; })); });
823826
permute(3, function(a) { test(a); });
824827
permute(3, function(a) { test(a.map(function(x, i) { return {reject:x}; })); });
825-
permute(3, function(a) { test(a.map(function(x, i) { return i == 0 ? {reject:x} : x; })); });
826-
permute(3, function(a) { test(a.map(function(x, i) { return i == 1 ? {reject:x} : x; })); });
828+
permute(3, function(a) { test(a.map(function(x, i) { return i === 0 ? {reject:x} : x; })); });
829+
permute(3, function(a) { test(a.map(function(x, i) { return i === 1 ? {reject:x} : x; })); });
827830
});
828831
});
829832

0 commit comments

Comments
 (0)