Skip to content

Commit 736b6c7

Browse files
style(*): fix no-useless-escape eslint errors
1 parent 1dedcdf commit 736b6c7

36 files changed

+59
-91
lines changed

docs/app/src/docs.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ angular.module('DocsController', ['currentVersionData'])
6363
$scope.loading = 0;
6464

6565

66-
var INDEX_PATH = /^(\/|\/index[^\.]*.html)$/;
66+
var INDEX_PATH = /^(\/|\/index[^.]*.html)$/;
6767
if (!$location.path() || INDEX_PATH.test($location.path())) {
6868
$location.path('/api').replace();
6969
}

docs/app/src/errors.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
angular.module('errors', ['ngSanitize'])
44

55
.filter('errorLink', ['$sanitize', function($sanitize) {
6-
var LINKY_URL_REGEXP = /((ftp|https?):\/\/|(mailto:)?[A-Za-z0-9._%+-]+@)\S*[^\s\.;,\(\)\{\}<>]/g,
6+
var LINKY_URL_REGEXP = /((ftp|https?):\/\/|(mailto:)?[A-Za-z0-9._%+-]+@)\S*[^\s.;,(){}<>]/g,
77
MAILTO_REGEXP = /^mailto:/,
88
STACK_TRACE_REGEXP = /:\d+:\d+$/;
99

docs/app/src/search.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ angular.module('search', [])
7272

7373
.controller('Error404SearchCtrl', ['$scope', '$location', 'docsSearch',
7474
function($scope, $location, docsSearch) {
75-
docsSearch($location.path().split(/[\/\.:]/).pop()).then(function(results) {
75+
docsSearch($location.path().split(/[/.:]/).pop()).then(function(results) {
7676
$scope.results = {};
7777
angular.forEach(results, function(result) {
7878
var area = $scope.results[result.area] || [];

docs/config/processors/keywords.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ module.exports = function generateKeywordsProcessor(log, readFilesProcessor) {
3434
var areasToSearch;
3535

3636
// Keywords start with "ng:" or one of $, _ or a letter
37-
var KEYWORD_REGEX = /^((ng:|[\$_a-z])[\w\-_]+)/;
37+
var KEYWORD_REGEX = /^((ng:|[$_a-z])[\w\-_]+)/;
3838

3939
// Load up the keywords to ignore, if specified in the config
4040
if (this.ignoreWordsFile) {
@@ -67,7 +67,7 @@ module.exports = function generateKeywordsProcessor(log, readFilesProcessor) {
6767

6868
function extractWords(text, words, keywordMap) {
6969

70-
var tokens = text.toLowerCase().split(/[\.\s,`'"#]+/mg);
70+
var tokens = text.toLowerCase().split(/[.\s,`'"#]+/mg);
7171
_.forEach(tokens, function(token) {
7272
var match = token.match(KEYWORD_REGEX);
7373
if (match) {

docs/content/guide/forms.ngdoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -363,7 +363,7 @@ In the following example we create two directives:
363363
<file name="script.js">
364364
var app = angular.module('form-example1', []);
365365

366-
var INTEGER_REGEXP = /^\-?\d+$/;
366+
var INTEGER_REGEXP = /^-?\d+$/;
367367
app.directive('integer', function() {
368368
return {
369369
require: 'ngModel',

init-repo.sh

Lines changed: 0 additions & 32 deletions
This file was deleted.

lib/grunt/utils.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ module.exports = {
178178
var classPathSep = (process.platform === 'win32') ? ';' : ':';
179179
var minFile = file.replace(/\.js$/, '.min.js');
180180
var mapFile = minFile + '.map';
181-
var mapFileName = mapFile.match(/[^\/]+$/)[0];
181+
var mapFileName = mapFile.match(/[^/]+$/)[0];
182182
var errorFileName = file.replace(/\.js$/, '-errors.json');
183183
var versionNumber = grunt.config('NG_VERSION').full;
184184
var compilationLevel = (file === 'build/angular-message-format.js') ?

lib/versions/version-info.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ var getPackage = function() {
3535
* @return {Object} An object containing the github owner and repository name
3636
*/
3737
var getGitRepoInfo = function() {
38-
var GITURL_REGEX = /^https:\/\/github.com\/([^\/]+)\/(.+).git$/;
38+
var GITURL_REGEX = /^https:\/\/github.com\/([^/]+)\/(.+).git$/;
3939
var match = GITURL_REGEX.exec(currentPackage.repository.url);
4040
var git = {
4141
owner: match[1],
File renamed without changes.

compare-master-to-stable.js renamed to scripts/compare-master-to-stable.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ then(allInSeries(function(branch) {
144144
line = line.split(' ');
145145
var sha = line.shift();
146146
var msg = line.join(' ');
147-
return sha + ((/fix\([^\)]+\):/i.test(msg)) ? ' * ' : ' ') + msg;
147+
return sha + ((/fix\([^)]+\):/i.test(msg)) ? ' * ' : ' ') + msg;
148148
});
149149
branch.log = log.map(function(line) {
150150
return line.substr(41);

validate-commit-msg.js renamed to scripts/validate-commit-msg.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ var util = require('util');
1616

1717

1818
var MAX_LENGTH = 100;
19-
var PATTERN = /^(?:fixup!\s*)?(\w*)(\(([\w\$\.\*/-]*)\))?: (.*)$/;
19+
var PATTERN = /^(?:fixup!\s*)?(\w*)(\(([\w$.*/-]*)\))?: (.*)$/;
2020
var IGNORED = /^WIP:/;
2121
var TYPES = {
2222
feat: true,
File renamed without changes.

src/Angular.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -710,7 +710,7 @@ function isPromiseLike(obj) {
710710
}
711711

712712

713-
var TYPED_ARRAY_REGEXP = /^\[object (?:Uint8|Uint8Clamped|Uint16|Uint32|Int8|Int16|Int32|Float32|Float64)Array\]$/;
713+
var TYPED_ARRAY_REGEXP = /^\[object (?:Uint8|Uint8Clamped|Uint16|Uint32|Int8|Int16|Int32|Float32|Float64)Array]$/;
714714
function isTypedArray(value) {
715715
return value && isNumber(value.length) && TYPED_ARRAY_REGEXP.test(toString.call(value));
716716
}
@@ -729,7 +729,7 @@ var trim = function(value) {
729729
// Prereq: s is a string.
730730
var escapeForRegexp = function(s) {
731731
return s
732-
.replace(/([-()\[\]{}+?*.$\^|,:#<!\\])/g, '\\$1')
732+
.replace(/([-()[\]{}+?*.$^|,:#<!\\])/g, '\\$1')
733733
// eslint-disable-next-line no-control-regex
734734
.replace(/\x08/g, '\\x08');
735735
};
@@ -973,7 +973,7 @@ function copy(source, destination) {
973973
return new source.constructor(source.valueOf());
974974

975975
case '[object RegExp]':
976-
var re = new RegExp(source.source, source.toString().match(/[^\/]*$/)[0]);
976+
var re = new RegExp(source.source, source.toString().match(/[^/]*$/)[0]);
977977
re.lastIndex = source.lastIndex;
978978
return re;
979979

@@ -1350,7 +1350,7 @@ function startingTag(element) {
13501350
return element[0].nodeType === NODE_TYPE_TEXT ? lowercase(elemHtml) :
13511351
elemHtml.
13521352
match(/^(<[^>]+>)/)[1].
1353-
replace(/^<([\w\-]+)/, function(match, nodeName) {return '<' + lowercase(nodeName);});
1353+
replace(/^<([\w-]+)/, function(match, nodeName) {return '<' + lowercase(nodeName);});
13541354
} catch (e) {
13551355
return lowercase(elemHtml);
13561356
}

src/auto/injector.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,8 @@
6363
* Implicit module which gets automatically added to each {@link auto.$injector $injector}.
6464
*/
6565

66-
var ARROW_ARG = /^([^\(]+?)=>/;
67-
var FN_ARGS = /^[^\(]*\(\s*([^\)]*)\)/m;
66+
var ARROW_ARG = /^([^(]+?)=>/;
67+
var FN_ARGS = /^[^(]*\(\s*([^)]*)\)/m;
6868
var FN_ARG_SPLIT = /,/;
6969
var FN_ARG = /^\s*(_?)(\S+?)\1\s*$/;
7070
var STRIP_COMMENTS = /((\/\/.*$)|(\/\*[\s\S]*?\*\/))/mg;

src/ng/browser.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,7 @@ function Browser(window, document, $log, $sniffer) {
302302
*/
303303
self.baseHref = function() {
304304
var href = baseElement.attr('href');
305-
return href ? href.replace(/^(https?:)?\/\/[^\/]*/, '') : '';
305+
return href ? href.replace(/^(https?:)?\/\/[^/]*/, '') : '';
306306
};
307307

308308
/**

src/ng/compile.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -971,8 +971,8 @@ $CompileProvider.$inject = ['$provide', '$$sanitizeUriProvider'];
971971
function $CompileProvider($provide, $$sanitizeUriProvider) {
972972
var hasDirectives = {},
973973
Suffix = 'Directive',
974-
COMMENT_DIRECTIVE_REGEXP = /^\s*directive:\s*([\w\-]+)\s+(.*)$/,
975-
CLASS_DIRECTIVE_REGEXP = /(([\w\-]+)(?::([^;]+))?;?)/,
974+
COMMENT_DIRECTIVE_REGEXP = /^\s*directive:\s*([\w-]+)\s+(.*)$/,
975+
CLASS_DIRECTIVE_REGEXP = /(([\w-]+)(?::([^;]+))?;?)/,
976976
ALL_OR_NOTHING_ATTRS = makeMap('ngSrc,ngSrcset,src,srcset'),
977977
REQUIRE_PREFIX_REGEXP = /^(?:(\^\^?)?(\?)?(\^\^?)?)?/;
978978

src/ng/directive/input.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,11 @@ var ISO_DATE_REGEXP = /^\d{4,}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d\.\d+(?:[+-
2121
// 7. Path
2222
// 8. Query
2323
// 9. Fragment
24-
// 1111111111111111 222 333333 44444 555555555555555555555555 666 77777777 8888888 999
25-
var URL_REGEXP = /^[a-z][a-z\d.+-]*:\/*(?:[^:@]+(?::[^@]+)?@)?(?:[^\s:/?#]+|\[[a-f\d:]+\])(?::\d+)?(?:\/[^?#]*)?(?:\?[^#]*)?(?:#.*)?$/i;
24+
// 1111111111111111 222 333333 44444 55555555555555555555555 666 77777777 8888888 999
25+
var URL_REGEXP = /^[a-z][a-z\d.+-]*:\/*(?:[^:@]+(?::[^@]+)?@)?(?:[^\s:/?#]+|\[[a-f\d:]+])(?::\d+)?(?:\/[^?#]*)?(?:\?[^#]*)?(?:#.*)?$/i;
2626
// eslint-disable-next-line max-len
27-
var EMAIL_REGEXP = /^(?=.{1,254}$)(?=.{1,64}@)[-!#$%&'*+\/0-9=?A-Z^_`a-z{|}~]+(\.[-!#$%&'*+\/0-9=?A-Z^_`a-z{|}~]+)*@[A-Za-z0-9]([A-Za-z0-9-]{0,61}[A-Za-z0-9])?(\.[A-Za-z0-9]([A-Za-z0-9-]{0,61}[A-Za-z0-9])?)*$/;
28-
var NUMBER_REGEXP = /^\s*(\-|\+)?(\d+|(\d*(\.\d*)))([eE][+-]?\d+)?\s*$/;
27+
var EMAIL_REGEXP = /^(?=.{1,254}$)(?=.{1,64}@)[-!#$%&'*+/0-9=?A-Z^_`a-z{|}~]+(\.[-!#$%&'*+/0-9=?A-Z^_`a-z{|}~]+)*@[A-Za-z0-9]([A-Za-z0-9-]{0,61}[A-Za-z0-9])?(\.[A-Za-z0-9]([A-Za-z0-9-]{0,61}[A-Za-z0-9])?)*$/;
28+
var NUMBER_REGEXP = /^\s*(-|\+)?(\d+|(\d*(\.\d*)))([eE][+-]?\d+)?\s*$/;
2929
var DATE_REGEXP = /^(\d{4,})-(\d{2})-(\d{2})$/;
3030
var DATETIMELOCAL_REGEXP = /^(\d{4,})-(\d\d)-(\d\d)T(\d\d):(\d\d)(?::(\d\d)(\.\d{1,3})?)?$/;
3131
var WEEK_REGEXP = /^(\d{4,})-W(\d\d)$/;

src/ng/directive/ngOptions.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -232,8 +232,8 @@ var ngOptionsMinErr = minErr('ngOptions');
232232
*/
233233

234234
/* eslint-disable max-len */
235-
// //00001111111111000000000002222222222000000000000000000000333333333300000000000000000000000004444444444400000000000005555555555555550000000006666666666666660000000777777777777777000000000000000888888888800000000000000000009999999999
236-
var NG_OPTIONS_REGEXP = /^\s*([\s\S]+?)(?:\s+as\s+([\s\S]+?))?(?:\s+group\s+by\s+([\s\S]+?))?(?:\s+disable\s+when\s+([\s\S]+?))?\s+for\s+(?:([\$\w][\$\w]*)|(?:\(\s*([\$\w][\$\w]*)\s*,\s*([\$\w][\$\w]*)\s*\)))\s+in\s+([\s\S]+?)(?:\s+track\s+by\s+([\s\S]+?))?$/;
235+
// //00001111111111000000000002222222222000000000000000000000333333333300000000000000000000000004444444444400000000000005555555555555000000000666666666666600000007777777777777000000000000000888888888800000000000000000009999999999
236+
var NG_OPTIONS_REGEXP = /^\s*([\s\S]+?)(?:\s+as\s+([\s\S]+?))?(?:\s+group\s+by\s+([\s\S]+?))?(?:\s+disable\s+when\s+([\s\S]+?))?\s+for\s+(?:([$\w][$\w]*)|(?:\(\s*([$\w][$\w]*)\s*,\s*([$\w][$\w]*)\s*\)))\s+in\s+([\s\S]+?)(?:\s+track\s+by\s+([\s\S]+?))?$/;
237237
// 1: value expression (valueFn)
238238
// 2: label expression (displayFn)
239239
// 3: group by expression (groupByFn)

src/ng/directive/ngRepeat.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -384,7 +384,7 @@ var ngRepeatDirective = ['$parse', '$animate', '$compile', function($parse, $ani
384384
var aliasAs = match[3];
385385
var trackByExp = match[4];
386386

387-
match = lhs.match(/^(?:(\s*[\$\w]+)|\(\s*([\$\w]+)\s*,\s*([\$\w]+)\s*\))$/);
387+
match = lhs.match(/^(?:(\s*[$\w]+)|\(\s*([$\w]+)\s*,\s*([$\w]+)\s*\))$/);
388388

389389
if (!match) {
390390
throw ngRepeatMinErr('iidexp', '\'_item_\' in \'_item_ in _collection_\' should be an identifier or \'(_key_, _value_)\' expression, but got \'{0}\'.',

src/ng/filter/filters.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -476,7 +476,7 @@ var DATE_FORMATS = {
476476
};
477477

478478
var DATE_FORMATS_SPLIT = /((?:[^yMLdHhmsaZEwG']+)|(?:'(?:[^']|'')*')|(?:E+|y+|M+|L+|d+|H+|h+|m+|s+|a|Z|G+|w+))(.*)/,
479-
NUMBER_STRING = /^\-?\d+$/;
479+
NUMBER_STRING = /^-?\d+$/;
480480

481481
/**
482482
* @ngdoc filter
@@ -563,7 +563,7 @@ var DATE_FORMATS_SPLIT = /((?:[^yMLdHhmsaZEwG']+)|(?:'(?:[^']|'')*')|(?:E+|y+|M+
563563
expect(element(by.binding("1288323623006 | date:'medium'")).getText()).
564564
toMatch(/Oct 2\d, 2010 \d{1,2}:\d{2}:\d{2} (AM|PM)/);
565565
expect(element(by.binding("1288323623006 | date:'yyyy-MM-dd HH:mm:ss Z'")).getText()).
566-
toMatch(/2010\-10\-2\d \d{2}:\d{2}:\d{2} (\-|\+)?\d{4}/);
566+
toMatch(/2010-10-2\d \d{2}:\d{2}:\d{2} (-|\+)?\d{4}/);
567567
expect(element(by.binding("'1288323623006' | date:'MM/dd/yyyy @ h:mma'")).getText()).
568568
toMatch(/10\/2\d\/2010 @ \d{1,2}:\d{2}(AM|PM)/);
569569
expect(element(by.binding("'1288323623006' | date:\"MM/dd/yyyy 'at' h:mma\"")).getText()).

src/ng/http.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ var JSON_ENDS = {
77
'[': /]$/,
88
'{': /}$/
99
};
10-
var JSON_PROTECTION_PREFIX = /^\)\]\}',?\n/;
10+
var JSON_PROTECTION_PREFIX = /^\)]\}',?\n/;
1111
var $httpMinErr = minErr('$http');
1212

1313
function serializeValue(v) {

src/ng/location.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
'use strict';
22

3-
var PATH_MATCH = /^([^\?#]*)(\?([^#]*))?(#(.*))?$/,
3+
var PATH_MATCH = /^([^?#]*)(\?([^#]*))?(#(.*))?$/,
44
DEFAULT_PORTS = {'http': 80, 'https': 443, 'ftp': 21};
55
var $locationMinErr = minErr('$location');
66

src/ngMock/angular-mocks.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1588,7 +1588,7 @@ function createHttpBackendMock($rootScope, $timeout, $delegate, $browser) {
15881588

15891589
url = url
15901590
.replace(/([().])/g, '\\$1')
1591-
.replace(/(\/)?:(\w+)([\?\*])?/g, function(_, slash, key, option) {
1591+
.replace(/(\/)?:(\w+)([?*])?/g, function(_, slash, key, option) {
15921592
var optional = option === '?' ? option : null;
15931593
var star = option === '*' ? option : null;
15941594
keys.push({ name: key, optional: !!optional });
@@ -1602,7 +1602,7 @@ function createHttpBackendMock($rootScope, $timeout, $delegate, $browser) {
16021602
+ ')'
16031603
+ (optional || '');
16041604
})
1605-
.replace(/([\/$\*])/g, '\\$1');
1605+
.replace(/([/$*])/g, '\\$1');
16061606

16071607
ret.regexp = new RegExp('^' + url, 'i');
16081608
return ret;

src/ngResource/resource.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -430,7 +430,7 @@ function shallowClearAndCopy(src, dst) {
430430
*/
431431
angular.module('ngResource', ['ng']).
432432
provider('$resource', function ResourceProvider() {
433-
var PROTOCOL_AND_DOMAIN_REGEX = /^https?:\/\/[^\/]*/;
433+
var PROTOCOL_AND_DOMAIN_REGEX = /^https?:\/\/[^/]*/;
434434

435435
var provider = this;
436436

src/ngRoute/route.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,7 @@ function $RouteProvider() {
261261

262262
path = path
263263
.replace(/([().])/g, '\\$1')
264-
.replace(/(\/)?:(\w+)(\*\?|[\?\*])?/g, function(_, slash, key, option) {
264+
.replace(/(\/)?:(\w+)(\*\?|[?*])?/g, function(_, slash, key, option) {
265265
var optional = (option === '?' || option === '*?') ? '?' : null;
266266
var star = (option === '*' || option === '*?') ? '*' : null;
267267
keys.push({ name: key, optional: !!optional });
@@ -275,7 +275,7 @@ function $RouteProvider() {
275275
+ ')'
276276
+ (optional || '');
277277
})
278-
.replace(/([\/$\*])/g, '\\$1');
278+
.replace(/([/$*])/g, '\\$1');
279279

280280
ret.regexp = new RegExp('^' + path + '$', insensitive ? 'i' : '');
281281
return ret;

test/auto/injectorSpec.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -418,7 +418,7 @@ describe('injector', function() {
418418
expect(function() {
419419
createInjector(['IDontExist'], {});
420420
}).toThrowMinErr('$injector', 'modulerr',
421-
/\[\$injector:nomod\] Module 'IDontExist' is not available! You either misspelled the module name or forgot to load it/);
421+
/\[\$injector:nomod] Module 'IDontExist' is not available! You either misspelled the module name or forgot to load it/);
422422
});
423423

424424

@@ -782,7 +782,7 @@ describe('injector', function() {
782782
createInjector([
783783
{}
784784
], {});
785-
}).toThrowMinErr('$injector', 'modulerr', /Failed to instantiate module \{\} due to:\n.*\[ng:areq\] Argument 'module' is not a function, got Object/);
785+
}).toThrowMinErr('$injector', 'modulerr', /Failed to instantiate module \{\} due to:\n.*\[ng:areq] Argument 'module' is not a function, got Object/);
786786
});
787787

788788

test/helpers/matchers.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ beforeEach(function() {
6060
// This function escapes all special regex characters.
6161
// We use it to create matching regex from arbitrary strings.
6262
// http://stackoverflow.com/questions/3446170/escape-string-for-use-in-javascript-regex
63-
return str.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, '\\$&');
63+
return str.replace(/[-[\]/{}()*+?.\\^$|]/g, '\\$&');
6464
}
6565

6666
function test(exception) {

test/helpers/testabilityPatch.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ function sortedHtml(element, showNgClass) {
184184
}
185185

186186
var attr = attributes[i];
187-
if (attr.name.match(/^ng[:\-]/) ||
187+
if (attr.name.match(/^ng[:-]/) ||
188188
(attr.value || attr.value === '') &&
189189
attr.value !== 'null' &&
190190
attr.value !== 'auto' &&
@@ -241,7 +241,7 @@ function sortedHtml(element, showNgClass) {
241241
var tmp = style;
242242
style = [];
243243
forEach(tmp, function(value) {
244-
if (!value.match(/^max[^\-]/)) {
244+
if (!value.match(/^max[^-]/)) {
245245
style.push(value);
246246
}
247247
});

test/minErrSpec.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ describe('minErr', function() {
3434

3535
it('should interpolate string arguments without quotes', function() {
3636
var myError = testError('1', 'This {0} is "{1}"', 'foo', 'bar');
37-
expect(myError.message).toMatch(/^\[test:1\] This foo is "bar"/);
37+
expect(myError.message).toMatch(/^\[test:1] This foo is "bar"/);
3838
});
3939

4040
it('should interpolate non-string arguments', function() {
@@ -57,7 +57,7 @@ describe('minErr', function() {
5757
var myError = testError('26', 'false: {0}; zero: {1}; null: {2}; undefined: {3}; emptyStr: {4}',
5858
false, 0, null, undefined, '');
5959
expect(myError.message).
60-
toMatch(/^\[test:26\] false: false; zero: 0; null: null; undefined: undefined; emptyStr: /);
60+
toMatch(/^\[test:26] false: false; zero: 0; null: null; undefined: undefined; emptyStr: /);
6161
});
6262

6363
it('should handle arguments that are objects with cyclic references', function() {
@@ -74,20 +74,20 @@ describe('minErr', function() {
7474
var foo = 'Fooooo',
7575
myError = testError('26', 'This {0} is {1} on {2}', foo);
7676

77-
expect(myError.message).toMatch(/^\[test:26\] This Fooooo is \{1\} on \{2\}/);
77+
expect(myError.message).toMatch(/^\[test:26] This Fooooo is \{1\} on \{2\}/);
7878
});
7979

8080

8181
it('should pass through the message if no interpolation is needed', function() {
8282
var myError = testError('26', 'Something horrible happened!');
83-
expect(myError.message).toMatch(/^\[test:26\] Something horrible happened!/);
83+
expect(myError.message).toMatch(/^\[test:26] Something horrible happened!/);
8484
});
8585

8686
it('should include a namespace in the message only if it is namespaced', function() {
8787
var myError = emptyTestError('26', 'This is a {0}', 'Foo');
8888
var myNamespacedError = testError('26', 'That is a {0}', 'Bar');
89-
expect(myError.message).toMatch(/^\[26\] This is a Foo/);
90-
expect(myNamespacedError.message).toMatch(/^\[test:26\] That is a Bar/);
89+
expect(myError.message).toMatch(/^\[26] This is a Foo/);
90+
expect(myNamespacedError.message).toMatch(/^\[test:26] That is a Bar/);
9191
});
9292

9393

0 commit comments

Comments
 (0)