fix: make files in src/ jshint: eqeqeq compatible
Add exceptions to the rule in input, ngAria, and parse. For input and ngAria, the exception is to prevent a breaking change in the radio directive. A test for the input behavior has been added. For parse, the exception covers non-strict expression comparison.
This commit is contained in:
+8
-6
@@ -195,7 +195,7 @@ function isArrayLike(obj) {
|
||||
// NodeList objects (with `item` method) and
|
||||
// other objects with suitable length characteristics are array-like
|
||||
return isNumber(length) &&
|
||||
(length >= 0 && ((length - 1) in obj || obj instanceof Array) || typeof obj.item == 'function');
|
||||
(length >= 0 && ((length - 1) in obj || obj instanceof Array) || typeof obj.item === 'function');
|
||||
|
||||
}
|
||||
|
||||
@@ -241,7 +241,9 @@ function forEach(obj, iterator, context) {
|
||||
for (key in obj) {
|
||||
// Need to check if hasOwnProperty exists,
|
||||
// as on IE8 the result of querySelectorAll is an object without a hasOwnProperty function
|
||||
if (key != 'prototype' && key != 'length' && key != 'name' && (!obj.hasOwnProperty || obj.hasOwnProperty(key))) {
|
||||
if (key !== 'prototype' && key !== 'length' && key !== 'name' &&
|
||||
(!obj.hasOwnProperty || obj.hasOwnProperty(key))
|
||||
) {
|
||||
iterator.call(context, obj[key], key, obj);
|
||||
}
|
||||
}
|
||||
@@ -718,7 +720,7 @@ function nodeName_(element) {
|
||||
}
|
||||
|
||||
function includes(array, obj) {
|
||||
return Array.prototype.indexOf.call(array, obj) != -1;
|
||||
return Array.prototype.indexOf.call(array, obj) !== -1;
|
||||
}
|
||||
|
||||
function arrayRemove(array, value) {
|
||||
@@ -984,10 +986,10 @@ function equals(o1, o2) {
|
||||
if (o1 === null || o2 === null) return false;
|
||||
if (o1 !== o1 && o2 !== o2) return true; // NaN === NaN
|
||||
var t1 = typeof o1, t2 = typeof o2, length, key, keySet;
|
||||
if (t1 == t2 && t1 == 'object') {
|
||||
if (t1 === t2 && t1 === 'object') {
|
||||
if (isArray(o1)) {
|
||||
if (!isArray(o2)) return false;
|
||||
if ((length = o1.length) == o2.length) {
|
||||
if ((length = o1.length) === o2.length) {
|
||||
for (key = 0; key < length; key++) {
|
||||
if (!equals(o1[key], o2[key])) return false;
|
||||
}
|
||||
@@ -998,7 +1000,7 @@ function equals(o1, o2) {
|
||||
return equals(o1.getTime(), o2.getTime());
|
||||
} else if (isRegExp(o1)) {
|
||||
if (!isRegExp(o2)) return false;
|
||||
return o1.toString() == o2.toString();
|
||||
return o1.toString() === o2.toString();
|
||||
} else {
|
||||
if (isScope(o1) || isScope(o2) || isWindow(o1) || isWindow(o2) ||
|
||||
isArray(o2) || isDate(o2) || isRegExp(o2)) return false;
|
||||
|
||||
+1
-1
@@ -24,7 +24,7 @@ function hashKey(obj, nextUidFn) {
|
||||
}
|
||||
|
||||
var objType = typeof obj;
|
||||
if (objType == 'function' || (objType == 'object' && obj !== null)) {
|
||||
if (objType === 'function' || (objType === 'object' && obj !== null)) {
|
||||
key = obj.$$hashKey = objType + ':' + (nextUidFn || nextUid)();
|
||||
} else {
|
||||
key = objType + ':' + obj;
|
||||
|
||||
@@ -774,7 +774,7 @@ function createInjector(modulesToLoad, strictDi) {
|
||||
if (isArray(module)) {
|
||||
module = module[module.length - 1];
|
||||
}
|
||||
if (e.message && e.stack && e.stack.indexOf(e.message) == -1) {
|
||||
if (e.message && e.stack && e.stack.indexOf(e.message) === -1) {
|
||||
// Safari & FF's stack traces don't contain error.message content
|
||||
// unlike those of Chrome and IE
|
||||
// So if stack doesn't contain message, we create a new string that contains both.
|
||||
|
||||
+3
-3
@@ -277,7 +277,7 @@ function JQLite(element) {
|
||||
argIsString = true;
|
||||
}
|
||||
if (!(this instanceof JQLite)) {
|
||||
if (argIsString && element.charAt(0) != '<') {
|
||||
if (argIsString && element.charAt(0) !== '<') {
|
||||
throw jqLiteMinErr('nosel', 'Looking up elements via selectors is not supported by jqLite! See: http://docs.angularjs.org/api/angular.element');
|
||||
}
|
||||
return new JQLite(element);
|
||||
@@ -472,7 +472,7 @@ function jqLiteController(element, name) {
|
||||
function jqLiteInheritedData(element, name, value) {
|
||||
// if element is the document object work with the html element instead
|
||||
// this makes $(document).scope() possible
|
||||
if (element.nodeType == NODE_TYPE_DOCUMENT) {
|
||||
if (element.nodeType === NODE_TYPE_DOCUMENT) {
|
||||
element = element.documentElement;
|
||||
}
|
||||
var names = isArray(name) ? name : [name];
|
||||
@@ -724,7 +724,7 @@ forEach({
|
||||
// in a way that survives minification.
|
||||
// jqLiteEmpty takes no arguments but is a setter.
|
||||
if (fn !== jqLiteEmpty &&
|
||||
(isUndefined((fn.length == 2 && (fn !== jqLiteHasClass && fn !== jqLiteController)) ? arg1 : arg2))) {
|
||||
(isUndefined((fn.length === 2 && (fn !== jqLiteHasClass && fn !== jqLiteController)) ? arg1 : arg2))) {
|
||||
if (isObject(arg1)) {
|
||||
|
||||
// we are a write, but the object properties are the key/values
|
||||
|
||||
@@ -216,8 +216,8 @@ function $CacheFactoryProvider() {
|
||||
|
||||
if (!lruEntry) return;
|
||||
|
||||
if (lruEntry == freshEnd) freshEnd = lruEntry.p;
|
||||
if (lruEntry == staleEnd) staleEnd = lruEntry.n;
|
||||
if (lruEntry === freshEnd) freshEnd = lruEntry.p;
|
||||
if (lruEntry === staleEnd) staleEnd = lruEntry.n;
|
||||
link(lruEntry.n,lruEntry.p);
|
||||
|
||||
delete lruHash[key];
|
||||
@@ -289,10 +289,10 @@ function $CacheFactoryProvider() {
|
||||
* makes the `entry` the freshEnd of the LRU linked list
|
||||
*/
|
||||
function refresh(entry) {
|
||||
if (entry != freshEnd) {
|
||||
if (entry !== freshEnd) {
|
||||
if (!staleEnd) {
|
||||
staleEnd = entry;
|
||||
} else if (staleEnd == entry) {
|
||||
} else if (staleEnd === entry) {
|
||||
staleEnd = entry.n;
|
||||
}
|
||||
|
||||
@@ -308,7 +308,7 @@ function $CacheFactoryProvider() {
|
||||
* bidirectionally links two entries of the LRU linked list
|
||||
*/
|
||||
function link(nextEntry, prevEntry) {
|
||||
if (nextEntry != prevEntry) {
|
||||
if (nextEntry !== prevEntry) {
|
||||
if (nextEntry) nextEntry.p = prevEntry; //p stands for previous, 'prev' didn't minify
|
||||
if (prevEntry) prevEntry.n = nextEntry; //n stands for next, 'next' didn't minify
|
||||
}
|
||||
|
||||
+19
-19
@@ -1551,7 +1551,7 @@ function $CompileProvider($provide, $$sanitizeUriProvider) {
|
||||
|
||||
var startSymbol = $interpolate.startSymbol(),
|
||||
endSymbol = $interpolate.endSymbol(),
|
||||
denormalizeTemplate = (startSymbol == '{{' && endSymbol == '}}')
|
||||
denormalizeTemplate = (startSymbol === '{{' && endSymbol === '}}')
|
||||
? identity
|
||||
: function denormalizeTemplate(template) {
|
||||
return template.replace(/\{\{/g, startSymbol).replace(/}}/g, endSymbol);
|
||||
@@ -1946,7 +1946,7 @@ function $CompileProvider($provide, $$sanitizeUriProvider) {
|
||||
"Unterminated attribute, found '{0}' but no matching '{1}' found.",
|
||||
attrStart, attrEnd);
|
||||
}
|
||||
if (node.nodeType == NODE_TYPE_ELEMENT) {
|
||||
if (node.nodeType === NODE_TYPE_ELEMENT) {
|
||||
if (node.hasAttribute(attrStart)) depth++;
|
||||
if (node.hasAttribute(attrEnd)) depth--;
|
||||
}
|
||||
@@ -2132,7 +2132,7 @@ function $CompileProvider($provide, $$sanitizeUriProvider) {
|
||||
nonTlbTranscludeDirective = directive;
|
||||
}
|
||||
|
||||
if (directiveValue == 'element') {
|
||||
if (directiveValue === 'element') {
|
||||
hasElementTranscludeDirective = true;
|
||||
terminalPriority = directive.priority;
|
||||
$template = $compileNode;
|
||||
@@ -2250,7 +2250,7 @@ function $CompileProvider($provide, $$sanitizeUriProvider) {
|
||||
}
|
||||
compileNode = $template[0];
|
||||
|
||||
if ($template.length != 1 || compileNode.nodeType !== NODE_TYPE_ELEMENT) {
|
||||
if ($template.length !== 1 || compileNode.nodeType !== NODE_TYPE_ELEMENT) {
|
||||
throw $compileMinErr('tplrt',
|
||||
"Template for directive '{0}' must have exactly one root element. {1}",
|
||||
directiveName, '');
|
||||
@@ -2635,7 +2635,7 @@ function $CompileProvider($provide, $$sanitizeUriProvider) {
|
||||
try {
|
||||
directive = directives[i];
|
||||
if ((isUndefined(maxPriority) || maxPriority > directive.priority) &&
|
||||
directive.restrict.indexOf(location) != -1) {
|
||||
directive.restrict.indexOf(location) !== -1) {
|
||||
if (startAttrName) {
|
||||
directive = inherit(directive, {$$start: startAttrName, $$end: endAttrName});
|
||||
}
|
||||
@@ -2692,7 +2692,7 @@ function $CompileProvider($provide, $$sanitizeUriProvider) {
|
||||
|
||||
// reapply the old attributes to the new element
|
||||
forEach(dst, function(value, key) {
|
||||
if (key.charAt(0) != '$') {
|
||||
if (key.charAt(0) !== '$') {
|
||||
if (src[key] && src[key] !== value) {
|
||||
value += (key === 'style' ? ';' : ' ') + src[key];
|
||||
}
|
||||
@@ -2702,16 +2702,16 @@ function $CompileProvider($provide, $$sanitizeUriProvider) {
|
||||
|
||||
// copy the new attributes on the old attrs object
|
||||
forEach(src, function(value, key) {
|
||||
if (key == 'class') {
|
||||
if (key === 'class') {
|
||||
safeAddClass($element, value);
|
||||
dst['class'] = (dst['class'] ? dst['class'] + ' ' : '') + value;
|
||||
} else if (key == 'style') {
|
||||
} else if (key === 'style') {
|
||||
$element.attr('style', $element.attr('style') + ';' + value);
|
||||
dst['style'] = (dst['style'] ? dst['style'] + ';' : '') + value;
|
||||
// `dst` will never contain hasOwnProperty as DOM parser won't let it.
|
||||
// You will get an "InvalidCharacterError: DOM Exception 5" error if you
|
||||
// have an attribute like "has-own-property" or "data-has-own-property", etc.
|
||||
} else if (key.charAt(0) != '$' && !dst.hasOwnProperty(key)) {
|
||||
} else if (key.charAt(0) !== '$' && !dst.hasOwnProperty(key)) {
|
||||
dst[key] = value;
|
||||
dstAttr[key] = srcAttr[key];
|
||||
}
|
||||
@@ -2750,7 +2750,7 @@ function $CompileProvider($provide, $$sanitizeUriProvider) {
|
||||
}
|
||||
compileNode = $template[0];
|
||||
|
||||
if ($template.length != 1 || compileNode.nodeType !== NODE_TYPE_ELEMENT) {
|
||||
if ($template.length !== 1 || compileNode.nodeType !== NODE_TYPE_ELEMENT) {
|
||||
throw $compileMinErr('tplrt',
|
||||
"Template for directive '{0}' must have exactly one root element. {1}",
|
||||
origAsyncDirective.name, templateUrl);
|
||||
@@ -2778,7 +2778,7 @@ function $CompileProvider($provide, $$sanitizeUriProvider) {
|
||||
childTranscludeFn, $compileNode, origAsyncDirective, preLinkFns, postLinkFns,
|
||||
previousCompileContext);
|
||||
forEach($rootElement, function(node, i) {
|
||||
if (node == compileNode) {
|
||||
if (node === compileNode) {
|
||||
$rootElement[i] = $compileNode[0];
|
||||
}
|
||||
});
|
||||
@@ -2903,15 +2903,15 @@ function $CompileProvider($provide, $$sanitizeUriProvider) {
|
||||
|
||||
|
||||
function getTrustedContext(node, attrNormalizedName) {
|
||||
if (attrNormalizedName == "srcdoc") {
|
||||
if (attrNormalizedName === "srcdoc") {
|
||||
return $sce.HTML;
|
||||
}
|
||||
var tag = nodeName_(node);
|
||||
// maction[xlink:href] can source SVG. It's not limited to <maction>.
|
||||
if (attrNormalizedName == "xlinkHref" ||
|
||||
(tag == "form" && attrNormalizedName == "action") ||
|
||||
(tag != "img" && (attrNormalizedName == "src" ||
|
||||
attrNormalizedName == "ngSrc"))) {
|
||||
if (attrNormalizedName === "xlinkHref" ||
|
||||
(tag === "form" && attrNormalizedName === "action") ||
|
||||
(tag !== "img" && (attrNormalizedName === "src" ||
|
||||
attrNormalizedName === "ngSrc"))) {
|
||||
return $sce.RESOURCE_URL;
|
||||
}
|
||||
}
|
||||
@@ -2974,7 +2974,7 @@ function $CompileProvider($provide, $$sanitizeUriProvider) {
|
||||
//skip animations when the first digest occurs (when
|
||||
//both the new and the old values are the same) since
|
||||
//the CSS classes are the non-interpolated values
|
||||
if (name === 'class' && newValue != oldValue) {
|
||||
if (name === 'class' && newValue !== oldValue) {
|
||||
attr.$updateClass(newValue, oldValue);
|
||||
} else {
|
||||
attr.$set(name, newValue);
|
||||
@@ -3005,7 +3005,7 @@ function $CompileProvider($provide, $$sanitizeUriProvider) {
|
||||
|
||||
if ($rootElement) {
|
||||
for (i = 0, ii = $rootElement.length; i < ii; i++) {
|
||||
if ($rootElement[i] == firstElementToRemove) {
|
||||
if ($rootElement[i] === firstElementToRemove) {
|
||||
$rootElement[i++] = newNode;
|
||||
for (var j = i, j2 = j + removeCount - 1,
|
||||
jj = $rootElement.length;
|
||||
@@ -3308,7 +3308,7 @@ function tokenDifference(str1, str2) {
|
||||
for (var i = 0; i < tokens1.length; i++) {
|
||||
var token = tokens1[i];
|
||||
for (var j = 0; j < tokens2.length; j++) {
|
||||
if (token == tokens2[j]) continue outer;
|
||||
if (token === tokens2[j]) continue outer;
|
||||
}
|
||||
values += (values.length > 0 ? ' ' : '') + token;
|
||||
}
|
||||
|
||||
@@ -332,7 +332,7 @@ var ngAttributeAliasDirectives = {};
|
||||
// boolean attrs are evaluated
|
||||
forEach(BOOLEAN_ATTR, function(propName, attrName) {
|
||||
// binding to multiple is not supported
|
||||
if (propName == "multiple") return;
|
||||
if (propName === "multiple") return;
|
||||
|
||||
function defaultLinkFn(scope, element, attr) {
|
||||
scope.$watch(attr[normalized], function ngBooleanAttrWatchAction(value) {
|
||||
@@ -369,7 +369,7 @@ forEach(ALIASED_ATTR, function(htmlAttr, ngAttr) {
|
||||
link: function(scope, element, attr) {
|
||||
//special case ngPattern when a literal regular expression value
|
||||
//is used as the expression (this way we don't have to watch anything).
|
||||
if (ngAttr === "ngPattern" && attr.ngPattern.charAt(0) == "/") {
|
||||
if (ngAttr === "ngPattern" && attr.ngPattern.charAt(0) === "/") {
|
||||
var match = attr.ngPattern.match(REGEX_STRING_REGEXP);
|
||||
if (match) {
|
||||
attr.$set("ngPattern", new RegExp(match[1], match[2]));
|
||||
|
||||
@@ -1259,7 +1259,7 @@ function createDateParser(regexp, mapping) {
|
||||
// When a date is JSON'ified to wraps itself inside of an extra
|
||||
// set of double quotes. This makes the date parsing code unable
|
||||
// to match the date string and parse it as a date.
|
||||
if (iso.charAt(0) == '"' && iso.charAt(iso.length - 1) == '"') {
|
||||
if (iso.charAt(0) === '"' && iso.charAt(iso.length - 1) === '"') {
|
||||
iso = iso.substring(1, iso.length - 1);
|
||||
}
|
||||
if (ISO_DATE_REGEXP.test(iso)) {
|
||||
@@ -1476,6 +1476,8 @@ function radioInputType(scope, element, attr, ctrl) {
|
||||
|
||||
ctrl.$render = function() {
|
||||
var value = attr.value;
|
||||
// Strict comparison would cause a BC
|
||||
/* jshint eqeqeq:false */
|
||||
element[0].checked = (value == ctrl.$viewValue);
|
||||
};
|
||||
|
||||
|
||||
@@ -90,7 +90,7 @@ function classDirective(name, selector) {
|
||||
for (var i = 0; i < tokens1.length; i++) {
|
||||
var token = tokens1[i];
|
||||
for (var j = 0; j < tokens2.length; j++) {
|
||||
if (token == tokens2[j]) continue outer;
|
||||
if (token === tokens2[j]) continue outer;
|
||||
}
|
||||
values.push(token);
|
||||
}
|
||||
|
||||
@@ -519,7 +519,7 @@ var ngRepeatDirective = ['$parse', '$animate', '$compile', function($parse, $ani
|
||||
nextNode = nextNode.nextSibling;
|
||||
} while (nextNode && nextNode[NG_REMOVED]);
|
||||
|
||||
if (getBlockStart(block) != nextNode) {
|
||||
if (getBlockStart(block) !== nextNode) {
|
||||
// existing item which got moved
|
||||
$animate.move(getBlockNodes(block.clone), null, previousNode);
|
||||
}
|
||||
|
||||
@@ -38,7 +38,7 @@ var scriptDirective = ['$templateCache', function($templateCache) {
|
||||
restrict: 'E',
|
||||
terminal: true,
|
||||
compile: function(element, attr) {
|
||||
if (attr.type == 'text/ng-template') {
|
||||
if (attr.type === 'text/ng-template') {
|
||||
var templateUrl = attr.id,
|
||||
text = element[0].text;
|
||||
|
||||
|
||||
@@ -175,16 +175,16 @@ function parse(numStr) {
|
||||
}
|
||||
|
||||
// Count the number of leading zeros.
|
||||
for (i = 0; numStr.charAt(i) == ZERO_CHAR; i++) {/* jshint noempty: false */}
|
||||
for (i = 0; numStr.charAt(i) === ZERO_CHAR; i++) {/* jshint noempty: false */}
|
||||
|
||||
if (i == (zeros = numStr.length)) {
|
||||
if (i === (zeros = numStr.length)) {
|
||||
// The digits are all zero.
|
||||
digits = [0];
|
||||
numberOfIntegerDigits = 1;
|
||||
} else {
|
||||
// Count the number of trailing zeros
|
||||
zeros--;
|
||||
while (numStr.charAt(zeros) == ZERO_CHAR) zeros--;
|
||||
while (numStr.charAt(zeros) === ZERO_CHAR) zeros--;
|
||||
|
||||
// Trailing zeros are insignificant so ignore them
|
||||
numberOfIntegerDigits -= i;
|
||||
@@ -376,7 +376,7 @@ function dateGetter(name, size, offset, trim, negWrap) {
|
||||
if (offset > 0 || value > -offset) {
|
||||
value += offset;
|
||||
}
|
||||
if (value === 0 && offset == -12) value = 12;
|
||||
if (value === 0 && offset === -12) value = 12;
|
||||
return padNumber(value, size, trim, negWrap);
|
||||
};
|
||||
}
|
||||
|
||||
@@ -248,8 +248,8 @@ function orderByFilter($parse) {
|
||||
if (isFunction(predicate)) {
|
||||
get = predicate;
|
||||
} else if (isString(predicate)) {
|
||||
if ((predicate.charAt(0) == '+' || predicate.charAt(0) == '-')) {
|
||||
descending = predicate.charAt(0) == '-' ? -1 : 1;
|
||||
if ((predicate.charAt(0) === '+' || predicate.charAt(0) === '-')) {
|
||||
descending = predicate.charAt(0) === '-' ? -1 : 1;
|
||||
predicate = predicate.substring(1);
|
||||
}
|
||||
if (predicate !== '') {
|
||||
|
||||
+1
-1
@@ -1323,7 +1323,7 @@ function $HttpProvider() {
|
||||
|
||||
function buildUrl(url, serializedParams) {
|
||||
if (serializedParams.length > 0) {
|
||||
url += ((url.indexOf('?') == -1) ? '?' : '&') + serializedParams;
|
||||
url += ((url.indexOf('?') === -1) ? '?' : '&') + serializedParams;
|
||||
}
|
||||
return url;
|
||||
}
|
||||
|
||||
@@ -58,7 +58,7 @@ function createHttpBackend($browser, createXhr, $browserDefer, callbacks, rawDoc
|
||||
$browser.$$incOutstandingRequestCount();
|
||||
url = url || $browser.url();
|
||||
|
||||
if (lowercase(method) == 'jsonp') {
|
||||
if (lowercase(method) === 'jsonp') {
|
||||
var callbackId = '_' + (callbacks.counter++).toString(36);
|
||||
callbacks[callbackId] = function(data) {
|
||||
callbacks[callbackId].data = data;
|
||||
@@ -95,7 +95,7 @@ function createHttpBackend($browser, createXhr, $browserDefer, callbacks, rawDoc
|
||||
// Occurs when accessing file resources or on Android 4.1 stock browser
|
||||
// while retrieving files from application cache.
|
||||
if (status === 0) {
|
||||
status = response ? 200 : urlResolve(url).protocol == 'file' ? 404 : 0;
|
||||
status = response ? 200 : urlResolve(url).protocol === 'file' ? 404 : 0;
|
||||
}
|
||||
|
||||
completeRequest(callback,
|
||||
|
||||
@@ -257,8 +257,8 @@ function $InterpolateProvider() {
|
||||
expressionPositions = [];
|
||||
|
||||
while (index < textLength) {
|
||||
if (((startIndex = text.indexOf(startSymbol, index)) != -1) &&
|
||||
((endIndex = text.indexOf(endSymbol, startIndex + startSymbolLength)) != -1)) {
|
||||
if (((startIndex = text.indexOf(startSymbol, index)) !== -1) &&
|
||||
((endIndex = text.indexOf(endSymbol, startIndex + startSymbolLength)) !== -1)) {
|
||||
if (index !== startIndex) {
|
||||
concat.push(unescapeText(text.substring(index, startIndex)));
|
||||
}
|
||||
|
||||
+9
-9
@@ -43,7 +43,7 @@ function parseAppUrl(relativeUrl, locationObj) {
|
||||
locationObj.$$hash = decodeURIComponent(match.hash);
|
||||
|
||||
// make sure path starts with '/';
|
||||
if (locationObj.$$path && locationObj.$$path.charAt(0) != '/') {
|
||||
if (locationObj.$$path && locationObj.$$path.charAt(0) !== '/') {
|
||||
locationObj.$$path = '/' + locationObj.$$path;
|
||||
}
|
||||
}
|
||||
@@ -65,7 +65,7 @@ function beginsWith(begin, whole) {
|
||||
|
||||
function stripHash(url) {
|
||||
var index = url.indexOf('#');
|
||||
return index == -1 ? url : url.substr(0, index);
|
||||
return index === -1 ? url : url.substr(0, index);
|
||||
}
|
||||
|
||||
function trimEmptyHash(url) {
|
||||
@@ -150,7 +150,7 @@ function LocationHtml5Url(appBase, appBaseNoFile, basePrefix) {
|
||||
}
|
||||
} else if (isDefined(appUrl = beginsWith(appBaseNoFile, url))) {
|
||||
rewrittenUrl = appBaseNoFile + appUrl;
|
||||
} else if (appBaseNoFile == url + '/') {
|
||||
} else if (appBaseNoFile === url + '/') {
|
||||
rewrittenUrl = appBaseNoFile;
|
||||
}
|
||||
if (rewrittenUrl) {
|
||||
@@ -264,7 +264,7 @@ function LocationHashbangUrl(appBase, appBaseNoFile, hashPrefix) {
|
||||
};
|
||||
|
||||
this.$$parseLinkUrl = function(url, relHref) {
|
||||
if (stripHash(appBase) == stripHash(url)) {
|
||||
if (stripHash(appBase) === stripHash(url)) {
|
||||
this.$$parse(url);
|
||||
return true;
|
||||
}
|
||||
@@ -298,7 +298,7 @@ function LocationHashbangInHtml5Url(appBase, appBaseNoFile, hashPrefix) {
|
||||
var rewrittenUrl;
|
||||
var appUrl;
|
||||
|
||||
if (appBase == stripHash(url)) {
|
||||
if (appBase === stripHash(url)) {
|
||||
rewrittenUrl = url;
|
||||
} else if ((appUrl = beginsWith(appBaseNoFile, url))) {
|
||||
rewrittenUrl = appBase + hashPrefix + appUrl;
|
||||
@@ -486,7 +486,7 @@ var locationPrototype = {
|
||||
*/
|
||||
path: locationGetterSetter('$$path', function(path) {
|
||||
path = path !== null ? path.toString() : '';
|
||||
return path.charAt(0) == '/' ? path : '/' + path;
|
||||
return path.charAt(0) === '/' ? path : '/' + path;
|
||||
}),
|
||||
|
||||
/**
|
||||
@@ -858,7 +858,7 @@ function $LocationProvider() {
|
||||
// TODO(vojta): rewrite link when opening in new tab/window (in legacy browser)
|
||||
// currently we open nice url link and redirect then
|
||||
|
||||
if (!html5Mode.rewriteLinks || event.ctrlKey || event.metaKey || event.shiftKey || event.which == 2 || event.button == 2) return;
|
||||
if (!html5Mode.rewriteLinks || event.ctrlKey || event.metaKey || event.shiftKey || event.which === 2 || event.button === 2) return;
|
||||
|
||||
var elm = jqLite(event.target);
|
||||
|
||||
@@ -889,7 +889,7 @@ function $LocationProvider() {
|
||||
// getting double entries in the location history.
|
||||
event.preventDefault();
|
||||
// update location manually
|
||||
if ($location.absUrl() != $browser.url()) {
|
||||
if ($location.absUrl() !== $browser.url()) {
|
||||
$rootScope.$apply();
|
||||
// hack to work around FF6 bug 684208 when scenario runner clicks on links
|
||||
$window.angular['ff-684208-preventDefault'] = true;
|
||||
@@ -900,7 +900,7 @@ function $LocationProvider() {
|
||||
|
||||
|
||||
// rewrite hashbang url <> html5 url
|
||||
if (trimEmptyHash($location.absUrl()) != trimEmptyHash(initialUrl)) {
|
||||
if (trimEmptyHash($location.absUrl()) !== trimEmptyHash(initialUrl)) {
|
||||
$browser.url($location.absUrl(), true);
|
||||
}
|
||||
|
||||
|
||||
+8
-6
@@ -218,19 +218,19 @@ Lexer.prototype = {
|
||||
var start = this.index;
|
||||
while (this.index < this.text.length) {
|
||||
var ch = lowercase(this.text.charAt(this.index));
|
||||
if (ch == '.' || this.isNumber(ch)) {
|
||||
if (ch === '.' || this.isNumber(ch)) {
|
||||
number += ch;
|
||||
} else {
|
||||
var peekCh = this.peek();
|
||||
if (ch == 'e' && this.isExpOperator(peekCh)) {
|
||||
if (ch === 'e' && this.isExpOperator(peekCh)) {
|
||||
number += ch;
|
||||
} else if (this.isExpOperator(ch) &&
|
||||
peekCh && this.isNumber(peekCh) &&
|
||||
number.charAt(number.length - 1) == 'e') {
|
||||
number.charAt(number.length - 1) === 'e') {
|
||||
number += ch;
|
||||
} else if (this.isExpOperator(ch) &&
|
||||
(!peekCh || !this.isNumber(peekCh)) &&
|
||||
number.charAt(number.length - 1) == 'e') {
|
||||
number.charAt(number.length - 1) === 'e') {
|
||||
this.throwError('Invalid exponent');
|
||||
} else {
|
||||
break;
|
||||
@@ -748,7 +748,7 @@ function findConstantAndWatchExpressions(ast, $filter) {
|
||||
}
|
||||
|
||||
function getInputs(body) {
|
||||
if (body.length != 1) return;
|
||||
if (body.length !== 1) return;
|
||||
var lastExpression = body[0].expression;
|
||||
var candidate = lastExpression.toWatch;
|
||||
if (candidate.length !== 1) return candidate;
|
||||
@@ -1531,12 +1531,14 @@ ASTInterpreter.prototype = {
|
||||
},
|
||||
'binary==': function(left, right, context) {
|
||||
return function(scope, locals, assign, inputs) {
|
||||
/* jshint eqeqeq:false */
|
||||
var arg = left(scope, locals, assign, inputs) == right(scope, locals, assign, inputs);
|
||||
return context ? {value: arg} : arg;
|
||||
};
|
||||
},
|
||||
'binary!=': function(left, right, context) {
|
||||
return function(scope, locals, assign, inputs) {
|
||||
/* jshint eqeqeq:false */
|
||||
var arg = left(scope, locals, assign, inputs) != right(scope, locals, assign, inputs);
|
||||
return context ? {value: arg} : arg;
|
||||
};
|
||||
@@ -1677,7 +1679,7 @@ Parser.prototype = {
|
||||
};
|
||||
|
||||
function isPossiblyDangerousMemberName(name) {
|
||||
return name == 'constructor';
|
||||
return name === 'constructor';
|
||||
}
|
||||
|
||||
var objectValueOf = Object.prototype.valueOf;
|
||||
|
||||
+3
-3
@@ -262,7 +262,7 @@ function $RootScopeProvider() {
|
||||
// prototypically. In all other cases, this property needs to be set
|
||||
// when the parent scope is destroyed.
|
||||
// The listener needs to be added after the parent is set
|
||||
if (isolate || parent != this) child.$on('$destroy', destroyChildScope);
|
||||
if (isolate || parent !== this) child.$on('$destroy', destroyChildScope);
|
||||
|
||||
return child;
|
||||
},
|
||||
@@ -912,8 +912,8 @@ function $RootScopeProvider() {
|
||||
|
||||
// sever all the references to parent scopes (after this cleanup, the current scope should
|
||||
// not be retained by any of our references and should be eligible for garbage collection)
|
||||
if (parent && parent.$$childHead == this) parent.$$childHead = this.$$nextSibling;
|
||||
if (parent && parent.$$childTail == this) parent.$$childTail = this.$$prevSibling;
|
||||
if (parent && parent.$$childHead === this) parent.$$childHead = this.$$nextSibling;
|
||||
if (parent && parent.$$childTail === this) parent.$$childTail = this.$$prevSibling;
|
||||
if (this.$$prevSibling) this.$$prevSibling.$$nextSibling = this.$$nextSibling;
|
||||
if (this.$$nextSibling) this.$$nextSibling.$$prevSibling = this.$$prevSibling;
|
||||
|
||||
|
||||
@@ -39,7 +39,7 @@ function $$TestabilityProvider() {
|
||||
matches.push(binding);
|
||||
}
|
||||
} else {
|
||||
if (bindingName.indexOf(expression) != -1) {
|
||||
if (bindingName.indexOf(expression) !== -1) {
|
||||
matches.push(binding);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -279,7 +279,7 @@ function parseMaxTime(str) {
|
||||
forEach(values, function(value) {
|
||||
// it's always safe to consider only second values and omit `ms` values since
|
||||
// getComputedStyle will always handle the conversion for us
|
||||
if (value.charAt(value.length - 1) == 's') {
|
||||
if (value.charAt(value.length - 1) === 's') {
|
||||
value = value.substring(0, value.length - 1);
|
||||
}
|
||||
value = parseFloat(value) || 0;
|
||||
@@ -600,7 +600,7 @@ var $AnimateCssProvider = ['$animateProvider', function($animateProvider) {
|
||||
var flags = {};
|
||||
flags.hasTransitions = timings.transitionDuration > 0;
|
||||
flags.hasAnimations = timings.animationDuration > 0;
|
||||
flags.hasTransitionAll = flags.hasTransitions && timings.transitionProperty == 'all';
|
||||
flags.hasTransitionAll = flags.hasTransitions && timings.transitionProperty === 'all';
|
||||
flags.applyTransitionDuration = hasToStyles && (
|
||||
(flags.hasTransitions && !flags.hasTransitionAll)
|
||||
|| (flags.hasAnimations && !flags.hasTransitions));
|
||||
|
||||
@@ -43,7 +43,7 @@ var $$AnimateJsProvider = ['$animateProvider', function($animateProvider) {
|
||||
var before, after;
|
||||
if (animations.length) {
|
||||
var afterFn, beforeFn;
|
||||
if (event == 'leave') {
|
||||
if (event === 'leave') {
|
||||
beforeFn = 'leave';
|
||||
afterFn = 'afterLeave'; // TODO(matsko): get rid of this
|
||||
} else {
|
||||
|
||||
@@ -62,7 +62,7 @@ var $$AnimateQueueProvider = ['$animateProvider', function($animateProvider) {
|
||||
rules.skip.push(function(element, newAnimation, currentAnimation) {
|
||||
// why should we trigger a new structural animation if the element will
|
||||
// be removed from the DOM anyway?
|
||||
return currentAnimation.event == 'leave' && newAnimation.structural;
|
||||
return currentAnimation.event === 'leave' && newAnimation.structural;
|
||||
});
|
||||
|
||||
rules.skip.push(function(element, newAnimation, currentAnimation) {
|
||||
@@ -354,7 +354,7 @@ var $$AnimateQueueProvider = ['$animateProvider', function($animateProvider) {
|
||||
|
||||
// there is no point in traversing the same collection of parent ancestors if a followup
|
||||
// animation will be run on the same element that already did all that checking work
|
||||
if (!skipAnimations && (!hasExistingAnimation || existingAnimation.state != PRE_DIGEST_STATE)) {
|
||||
if (!skipAnimations && (!hasExistingAnimation || existingAnimation.state !== PRE_DIGEST_STATE)) {
|
||||
skipAnimations = !areAnimationsAllowed(element, parent, event);
|
||||
}
|
||||
|
||||
|
||||
@@ -258,6 +258,8 @@ ngAriaModule.directive('ngShow', ['$aria', function($aria) {
|
||||
}
|
||||
|
||||
function getRadioReaction(newVal) {
|
||||
// Strict comparison would cause a BC
|
||||
/* jshint eqeqeq:false */
|
||||
var boolVal = (attr.value == ngModel.$viewValue);
|
||||
elem.attr('aria-checked', boolVal);
|
||||
}
|
||||
|
||||
@@ -85,7 +85,7 @@ InterpolationParts.prototype.toParsedFn = function toParsedFn(mustHaveExpression
|
||||
$interpolateMinErr['throwNoconcat'](originalText);
|
||||
}
|
||||
if (this.expressionFns.length === 0) {
|
||||
if (this.textParts.length != 1) { this.errorInParseLogic(); }
|
||||
if (this.textParts.length !== 1) { this.errorInParseLogic(); }
|
||||
return parseTextLiteral(this.textParts[0]);
|
||||
}
|
||||
var parsedFn = function(context) {
|
||||
|
||||
@@ -92,7 +92,7 @@ MessageFormatParser.prototype.popState = function popState() {
|
||||
MessageFormatParser.prototype.matchRe = function matchRe(re, search) {
|
||||
re.lastIndex = this.index;
|
||||
var match = re.exec(this.text);
|
||||
if (match != null && (search === true || (match.index == this.index))) {
|
||||
if (match != null && (search === true || (match.index === this.index))) {
|
||||
this.index = re.lastIndex;
|
||||
return match;
|
||||
}
|
||||
@@ -146,7 +146,7 @@ MessageFormatParser.prototype.errorExpecting = function errorExpecting() {
|
||||
position.line, position.column, this.text);
|
||||
}
|
||||
var word = match[1];
|
||||
if (word == "select" || word == "plural") {
|
||||
if (word === "select" || word === "plural") {
|
||||
position = indexToLineAndColumn(this.text, this.index);
|
||||
throw $interpolateMinErr('reqcomma',
|
||||
'Expected a comma after the keyword “{0}” at line {1}, column {2} of text “{3}”',
|
||||
@@ -174,7 +174,7 @@ MessageFormatParser.prototype.ruleString = function ruleString() {
|
||||
MessageFormatParser.prototype.startStringAtMatch = function startStringAtMatch(match) {
|
||||
this.stringStartIndex = match.index;
|
||||
this.stringQuote = match[0];
|
||||
this.stringInterestsRe = this.stringQuote == "'" ? SQUOTED_STRING_INTEREST_RE : DQUOTED_STRING_INTEREST_RE;
|
||||
this.stringInterestsRe = this.stringQuote === "'" ? SQUOTED_STRING_INTEREST_RE : DQUOTED_STRING_INTEREST_RE;
|
||||
this.rule = this.ruleInsideString;
|
||||
};
|
||||
|
||||
@@ -188,8 +188,7 @@ MessageFormatParser.prototype.ruleInsideString = function ruleInsideString() {
|
||||
'The string beginning at line {0}, column {1} is unterminated in text “{2}”',
|
||||
position.line, position.column, this.text);
|
||||
}
|
||||
var chars = match[0];
|
||||
if (match == this.stringQuote) {
|
||||
if (match[0] === this.stringQuote) {
|
||||
this.rule = null;
|
||||
}
|
||||
};
|
||||
@@ -298,7 +297,7 @@ MessageFormatParser.prototype.advanceInInterpolationOrMessageText = function adv
|
||||
return null;
|
||||
}
|
||||
} else {
|
||||
match = this.searchRe(this.ruleChoiceKeyword == this.rulePluralValueOrKeyword ?
|
||||
match = this.searchRe(this.ruleChoiceKeyword === this.rulePluralValueOrKeyword ?
|
||||
INTERP_OR_PLURALVALUE_OR_END_MESSAGE_RE : INTERP_OR_END_MESSAGE_RE);
|
||||
if (match == null) {
|
||||
var position = indexToLineAndColumn(this.text, this.msgStartIndex);
|
||||
@@ -323,20 +322,20 @@ MessageFormatParser.prototype.ruleInInterpolationOrMessageText = function ruleIn
|
||||
this.rule = null;
|
||||
return;
|
||||
}
|
||||
if (token[0] == "\\") {
|
||||
if (token[0] === "\\") {
|
||||
// unescape next character and continue
|
||||
this.interpolationParts.addText(this.textPart + token[1]);
|
||||
return;
|
||||
}
|
||||
this.interpolationParts.addText(this.textPart);
|
||||
if (token == "{{") {
|
||||
if (token === "{{") {
|
||||
this.pushState();
|
||||
this.ruleStack.push(this.ruleEndMustacheInInterpolationOrMessage);
|
||||
this.rule = this.ruleEnteredMustache;
|
||||
} else if (token == "}") {
|
||||
} else if (token === "}") {
|
||||
this.choices[this.choiceKey] = this.interpolationParts.toParsedFn(/*mustHaveExpression=*/false, this.text);
|
||||
this.rule = this.ruleChoiceKeyword;
|
||||
} else if (token == "#") {
|
||||
} else if (token === "#") {
|
||||
this.interpolationParts.addExpressionFn(this.expressionMinusOffsetFn);
|
||||
} else {
|
||||
this.errorInParseLogic();
|
||||
@@ -360,7 +359,7 @@ MessageFormatParser.prototype.ruleInInterpolation = function ruleInInterpolation
|
||||
return;
|
||||
}
|
||||
var token = match[0];
|
||||
if (token[0] == "\\") {
|
||||
if (token[0] === "\\") {
|
||||
// unescape next character and continue
|
||||
this.interpolationParts.addText(this.text.substring(currentIndex, match.index) + token[1]);
|
||||
return;
|
||||
@@ -472,12 +471,12 @@ MessageFormatParser.prototype.ruleInAngularExpression = function ruleInAngularEx
|
||||
this.getEndOperator(innermostOperator), this.text);
|
||||
}
|
||||
var operator = match[0];
|
||||
if (operator == "'" || operator == '"') {
|
||||
if (operator === "'" || operator === '"') {
|
||||
this.ruleStack.push(this.ruleInAngularExpression);
|
||||
this.startStringAtMatch(match);
|
||||
return;
|
||||
}
|
||||
if (operator == ",") {
|
||||
if (operator === ",") {
|
||||
if (this.trustedContext) {
|
||||
position = indexToLineAndColumn(this.text, this.index);
|
||||
throw $interpolateMinErr('unsafe',
|
||||
@@ -505,7 +504,7 @@ MessageFormatParser.prototype.ruleInAngularExpression = function ruleInAngularEx
|
||||
this.errorInParseLogic();
|
||||
}
|
||||
if (this.angularOperatorStack.length > 0) {
|
||||
if (beginOperator == this.angularOperatorStack[0]) {
|
||||
if (beginOperator === this.angularOperatorStack[0]) {
|
||||
this.angularOperatorStack.shift();
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -98,7 +98,7 @@ var $$MessageFormatFactory = ['$parse', '$locale', '$sce', '$exceptionHandler',
|
||||
}];
|
||||
|
||||
var $$interpolateDecorator = ['$$messageFormat', '$delegate', function $$interpolateDecorator($$messageFormat, $interpolate) {
|
||||
if ($interpolate['startSymbol']() != "{{" || $interpolate['endSymbol']() != "}}") {
|
||||
if ($interpolate['startSymbol']() !== "{{" || $interpolate['endSymbol']() !== "}}") {
|
||||
throw $interpolateMinErr('nochgmustache', 'angular-message-format.js currently does not allow you to use custom start and end symbols for interpolation.');
|
||||
}
|
||||
var interpolate = $$messageFormat['interpolate'];
|
||||
|
||||
@@ -460,7 +460,7 @@ angular.module('ngMessages', [])
|
||||
|
||||
// dive deeper into the DOM and examine its children for any ngMessage
|
||||
// comments that may be in an element that appears deeper in the list
|
||||
if (prevNode.childNodes.length && parentLookup.indexOf(prevNode) == -1) {
|
||||
if (prevNode.childNodes.length && parentLookup.indexOf(prevNode) === -1) {
|
||||
parentLookup.push(prevNode);
|
||||
prevNode = prevNode.childNodes[prevNode.childNodes.length - 1];
|
||||
} else if (prevNode.previousSibling) {
|
||||
|
||||
@@ -510,7 +510,7 @@ angular.module('ngResource', ['ng']).
|
||||
} else {
|
||||
url = url.replace(new RegExp("(\/?):" + urlParam + "(\\W|$)", "g"), function(match,
|
||||
leadingSlashes, tail) {
|
||||
if (tail.charAt(0) == '/') {
|
||||
if (tail.charAt(0) === '/') {
|
||||
return tail;
|
||||
} else {
|
||||
return leadingSlashes + tail;
|
||||
@@ -552,7 +552,7 @@ angular.module('ngResource', ['ng']).
|
||||
actionParams = extend({}, paramDefaults, actionParams);
|
||||
forEach(actionParams, function(value, key) {
|
||||
if (isFunction(value)) { value = value(); }
|
||||
ids[key] = value && value.charAt && value.charAt(0) == '@' ?
|
||||
ids[key] = value && value.charAt && value.charAt(0) === '@' ?
|
||||
lookupDottedPath(data, value.substr(1)) : value;
|
||||
});
|
||||
return ids;
|
||||
|
||||
@@ -172,7 +172,7 @@ function $RouteProvider() {
|
||||
|
||||
// create redirection for trailing slashes
|
||||
if (path) {
|
||||
var redirectPath = (path[path.length - 1] == '/')
|
||||
var redirectPath = (path[path.length - 1] === '/')
|
||||
? path.substr(0, path.length - 1)
|
||||
: path + '/';
|
||||
|
||||
@@ -634,7 +634,7 @@ function $RouteProvider() {
|
||||
}).
|
||||
then(function(locals) {
|
||||
// after route change
|
||||
if (nextRoute == $route.current) {
|
||||
if (nextRoute === $route.current) {
|
||||
if (nextRoute) {
|
||||
nextRoute.locals = locals;
|
||||
angular.copy(nextRoute.params, $routeParams);
|
||||
@@ -642,7 +642,7 @@ function $RouteProvider() {
|
||||
$rootScope.$broadcast('$routeChangeSuccess', nextRoute, lastRoute);
|
||||
}
|
||||
}, function(error) {
|
||||
if (nextRoute == $route.current) {
|
||||
if (nextRoute === $route.current) {
|
||||
$rootScope.$broadcast('$routeChangeError', nextRoute, lastRoute, error);
|
||||
}
|
||||
});
|
||||
|
||||
@@ -364,7 +364,7 @@ function htmlParser(html, handler) {
|
||||
|
||||
var nextNode;
|
||||
if (!(nextNode = node.firstChild)) {
|
||||
if (node.nodeType == 1) {
|
||||
if (node.nodeType === 1) {
|
||||
handler.end(node.nodeName.toLowerCase());
|
||||
}
|
||||
nextNode = node.nextSibling;
|
||||
@@ -373,7 +373,7 @@ function htmlParser(html, handler) {
|
||||
node = node.parentNode;
|
||||
if (node === inertBodyElement) break;
|
||||
nextNode = node.nextSibling;
|
||||
if (node.nodeType == 1) {
|
||||
if (node.nodeType === 1) {
|
||||
handler.end(node.nodeName.toLowerCase());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -113,7 +113,7 @@ angular.scenario.setUpAndRun = function(config) {
|
||||
}
|
||||
|
||||
angular.forEach(angular.scenario.output, function(fn, name) {
|
||||
if (!output.length || output.indexOf(name) != -1) {
|
||||
if (!output.length || output.indexOf(name) !== -1) {
|
||||
var context = body.append('<div></div>').find('div:last');
|
||||
context.attr('id', name);
|
||||
fn.call({}, context, $runner, objModel);
|
||||
@@ -272,9 +272,9 @@ _jQuery.fn.bindings = function(windowJquery, bindExp) {
|
||||
match = function(actualExp) {
|
||||
if (actualExp) {
|
||||
actualExp = actualExp.replace(/\s/g, '');
|
||||
if (actualExp == bindExp) return true;
|
||||
if (actualExp === bindExp) return true;
|
||||
if (actualExp.indexOf(bindExp) === 0) {
|
||||
return actualExp.charAt(bindExp.length) == '|';
|
||||
return actualExp.charAt(bindExp.length) === '|';
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -442,7 +442,7 @@ angular.scenario.dsl('element', function() {
|
||||
angular.forEach(KEY_VALUE_METHODS, function(methodName) {
|
||||
chain[methodName] = function(name, value) {
|
||||
var args = arguments,
|
||||
futureName = (args.length == 1)
|
||||
futureName = (args.length === 1)
|
||||
? "element '" + this.label + "' get " + methodName + " '" + name + "'"
|
||||
: "element '" + this.label + "' set " + methodName + " '" + name + "' to " + "'" +
|
||||
value + "'";
|
||||
|
||||
@@ -176,7 +176,7 @@ var ngTouchClickDirectiveFactory = ['$parse', '$timeout', '$rootElement',
|
||||
$timeout(function() {
|
||||
// Remove the allowable region.
|
||||
for (var i = 0; i < touchCoordinates.length; i += 2) {
|
||||
if (touchCoordinates[i] == x && touchCoordinates[i + 1] == y) {
|
||||
if (touchCoordinates[i] === x && touchCoordinates[i + 1] === y) {
|
||||
touchCoordinates.splice(i, i + 2);
|
||||
return;
|
||||
}
|
||||
@@ -216,7 +216,7 @@ var ngTouchClickDirectiveFactory = ['$parse', '$timeout', '$rootElement',
|
||||
tapping = true;
|
||||
tapElement = event.target ? event.target : event.srcElement; // IE uses srcElement.
|
||||
// Hack for Safari, which can target text nodes instead of containers.
|
||||
if (tapElement.nodeType == 3) {
|
||||
if (tapElement.nodeType === 3) {
|
||||
tapElement = tapElement.parentNode;
|
||||
}
|
||||
|
||||
|
||||
@@ -2953,6 +2953,19 @@ describe('input', function() {
|
||||
});
|
||||
|
||||
|
||||
// We generally use strict comparison. This tests behavior we cannot change without a BC
|
||||
it('should use non-strict comparison the evaluate checked-ness', function() {
|
||||
var inputElm = helper.compileInput(
|
||||
'<input type="radio" ng-model="model" value="0" />');
|
||||
|
||||
$rootScope.$apply("model = '0'");
|
||||
expect(inputElm[0].checked).toBe(true);
|
||||
|
||||
$rootScope.$apply("model = 0");
|
||||
expect(inputElm[0].checked).toBe(true);
|
||||
});
|
||||
|
||||
|
||||
it('should allow {{expr}} as value', function() {
|
||||
$rootScope.some = 11;
|
||||
var inputElm = helper.compileInput(
|
||||
|
||||
@@ -1739,6 +1739,7 @@ describe('parser', function() {
|
||||
expect(scope.$eval("!true")).toBeFalsy();
|
||||
expect(scope.$eval("1==1")).toBeTruthy();
|
||||
expect(scope.$eval("1==true")).toBeTruthy();
|
||||
expect(scope.$eval('1!=true')).toBeFalsy();
|
||||
expect(scope.$eval("1===1")).toBeTruthy();
|
||||
expect(scope.$eval("1==='1'")).toBeFalsy();
|
||||
expect(scope.$eval("1===true")).toBeFalsy();
|
||||
|
||||
Reference in New Issue
Block a user