Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

Commit ec565dd

Browse files
committed
chore(package): fix some warnings/errors
Related to #14952. Fixed the following warnings/errors: 1. **Warning**: Closure Compiler complained about `/* @this */` (annotations in non-JSDoc comments). Fixed by changing `/* @this */` to `/** @this */`. 2. **Warning**: Dgeni complained about `/** @this */` (invalid tags found). Fixed by adding an empty `this` tag definition in `docs/config/tag-defs/`. 3. **Error**: ESLint complained about CRLF linebreaks in `build/docs/examples/`. These are generated by dgeni and (apparently) use the system's default linebreak (e.g. CRLF on Windows). Fixed by disabling the `linebreak-style` rule for `build/docs/examples/`. Closes #14997
1 parent 975a617 commit ec565dd

40 files changed

+69
-61
lines changed

docs/app/src/search.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ angular.module('search', [])
9595
}
9696

9797
// Create the lunr index
98-
var index = lunr(/* @this */ function() {
98+
var index = lunr(/** @this */ function() {
9999
this.ref('path');
100100
this.field('titleWords', {boost: 50});
101101
this.field('members', { boost: 40});

docs/config/index.js

+1
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ module.exports = new Package('angularjs', [
5555
parseTagsProcessor.tagDefinitions.push(require('./tag-defs/tutorial-step'));
5656
parseTagsProcessor.tagDefinitions.push(require('./tag-defs/sortOrder'));
5757
parseTagsProcessor.tagDefinitions.push(require('./tag-defs/installation'));
58+
parseTagsProcessor.tagDefinitions.push(require('./tag-defs/this'));
5859
})
5960

6061

docs/config/tag-defs/this.js

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
'use strict';
2+
3+
module.exports = {
4+
name: 'this'
5+
};

docs/gulpfile.js

+2
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@ var getMergedEslintConfig = function(filepath) {
3434
strict: 'off',
3535
// Generated examples may miss the final EOL; ignore that.
3636
'eol-last': 'off',
37+
// Generated files use the system's default linebreak style (e.g. CRLF on Windows)
38+
'linebreak-style': 'off',
3739
// While alerts would be bad to have in the library or test code,
3840
// they're perfectly fine in examples.
3941
'no-alert': 'off',

src/apis.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ HashMap.prototype = {
7474
}
7575
};
7676

77-
var $$HashMapProvider = [/* @this */function() {
77+
var $$HashMapProvider = [/** @this */function() {
7878
this.$get = [function() {
7979
return HashMap;
8080
}];

src/auto/injector.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -710,7 +710,7 @@ function createInjector(modulesToLoad, strictDi) {
710710
}
711711

712712
function enforceReturnValue(name, factory) {
713-
return /* @this */ function enforcedReturnValue() {
713+
return /** @this */ function enforcedReturnValue() {
714714
var result = instanceInjector.invoke(factory, this);
715715
if (isUndefined(result)) {
716716
throw $injectorMinErr('undef', "Provider '{0}' must return a value from $get factory method.", name);

src/jqLite.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,7 @@ function jqLiteWrapNode(node, wrapper) {
262262

263263

264264
// IE9-11 has no method "contains" in SVG element and in Node.prototype. Bug #10259.
265-
var jqLiteContains = window.Node.prototype.contains || /* @this */ function(arg) {
265+
var jqLiteContains = window.Node.prototype.contains || /** @this */ function(arg) {
266266
// eslint-disable-next-line no-bitwise
267267
return !!(this.compareDocumentPosition(arg) & 16);
268268
};
@@ -1068,7 +1068,7 @@ forEach({
10681068

10691069

10701070
// Provider for private $$jqLite service
1071-
/* @this */
1071+
/** @this */
10721072
function $$jqLiteProvider() {
10731073
this.$get = function $$jqLite() {
10741074
return extend(JQLite, {

src/ng/animate.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -53,13 +53,13 @@ function prepareAnimateOptions(options) {
5353
: {};
5454
}
5555

56-
var $$CoreAnimateJsProvider = /* @this */ function() {
56+
var $$CoreAnimateJsProvider = /** @this */ function() {
5757
this.$get = noop;
5858
};
5959

6060
// this is prefixed with Core since it conflicts with
6161
// the animateQueueProvider defined in ngAnimate/animateQueue.js
62-
var $$CoreAnimateQueueProvider = /* @this */ function() {
62+
var $$CoreAnimateQueueProvider = /** @this */ function() {
6363
var postDigestQueue = new HashMap();
6464
var postDigestElements = [];
6565

@@ -177,7 +177,7 @@ var $$CoreAnimateQueueProvider = /* @this */ function() {
177177
*
178178
* To see the functional implementation check out `src/ngAnimate/animate.js`.
179179
*/
180-
var $AnimateProvider = ['$provide', /* @this */ function($provide) {
180+
var $AnimateProvider = ['$provide', /** @this */ function($provide) {
181181
var provider = this;
182182

183183
this.$$registeredAnimations = Object.create(null);

src/ng/animateRunner.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
'use strict';
22

3-
var $$AnimateAsyncRunFactoryProvider = /* @this */ function() {
3+
var $$AnimateAsyncRunFactoryProvider = /** @this */ function() {
44
this.$get = ['$$rAF', function($$rAF) {
55
var waitQueue = [];
66

@@ -31,7 +31,7 @@ var $$AnimateAsyncRunFactoryProvider = /* @this */ function() {
3131
}];
3232
};
3333

34-
var $$AnimateRunnerFactoryProvider = /* @this */ function() {
34+
var $$AnimateRunnerFactoryProvider = /** @this */ function() {
3535
this.$get = ['$q', '$sniffer', '$$animateAsyncRun', '$$isDocumentHidden', '$timeout',
3636
function($q, $sniffer, $$animateAsyncRun, $$isDocumentHidden, $timeout) {
3737

src/ng/browser.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -353,7 +353,7 @@ function Browser(window, document, $log, $sniffer) {
353353

354354
}
355355

356-
/* @this */
356+
/** @this */
357357
function $BrowserProvider() {
358358
this.$get = ['$window', '$log', '$sniffer', '$document',
359359
function($window, $log, $sniffer, $document) {

src/ng/compile.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -958,7 +958,7 @@ var _UNINITIALIZED_VALUE = new UNINITIALIZED_VALUE();
958958
* @description
959959
*/
960960
$CompileProvider.$inject = ['$provide', '$$sanitizeUriProvider'];
961-
/* @this */
961+
/** @this */
962962
function $CompileProvider($provide, $$sanitizeUriProvider) {
963963
var hasDirectives = {},
964964
Suffix = 'Directive',
@@ -1217,7 +1217,7 @@ function $CompileProvider($provide, $$sanitizeUriProvider) {
12171217
function factory($injector) {
12181218
function makeInjectable(fn) {
12191219
if (isFunction(fn) || isArray(fn)) {
1220-
return /* @this */ function(tElement, tAttrs) {
1220+
return /** @this */ function(tElement, tAttrs) {
12211221
return $injector.invoke(fn, this, {$element: tElement, $attrs: tAttrs});
12221222
};
12231223
} else {
@@ -2208,7 +2208,7 @@ function $CompileProvider($provide, $$sanitizeUriProvider) {
22082208
if (eager) {
22092209
return compile($compileNodes, transcludeFn, maxPriority, ignoreDirective, previousCompileContext);
22102210
}
2211-
return /* @this */ function lazyCompilation() {
2211+
return /** @this */ function lazyCompilation() {
22122212
if (!compiled) {
22132213
compiled = compile($compileNodes, transcludeFn, maxPriority, ignoreDirective, previousCompileContext);
22142214

src/ng/cookieReader.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ function $$CookieReader($document) {
5151

5252
$$CookieReader.$inject = ['$document'];
5353

54-
/* @this */
54+
/** @this */
5555
function $$CookieReaderProvider() {
5656
this.$get = $$CookieReader;
5757
}

src/ng/directive/input.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -1271,7 +1271,7 @@ function baseInputType(scope, element, attr, ctrl, $sniffer, $browser) {
12711271
}
12721272
};
12731273

1274-
element.on('keydown', /* @this */ function(event) {
1274+
element.on('keydown', /** @this */ function(event) {
12751275
var key = event.keyCode;
12761276

12771277
// ignore
@@ -1296,7 +1296,7 @@ function baseInputType(scope, element, attr, ctrl, $sniffer, $browser) {
12961296
// For these event types, when native validators are present and the browser supports the type,
12971297
// check for validity changes on various DOM events.
12981298
if (PARTIAL_VALIDATION_TYPES[type] && ctrl.$$hasNativeValidators && type === attr.type) {
1299-
element.on(PARTIAL_VALIDATION_EVENTS, /* @this */ function(ev) {
1299+
element.on(PARTIAL_VALIDATION_EVENTS, /** @this */ function(ev) {
13001300
if (!timeout) {
13011301
var validity = this[VALIDITY_STATE_PROPERTY];
13021302
var origBadInput = validity.badInput;

src/ng/directive/ngModel.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ is set to `true`. The parse error is stored in `ngModel.$error.parse`.
221221
*
222222
*/
223223
var NgModelController = ['$scope', '$exceptionHandler', '$attrs', '$element', '$parse', '$animate', '$timeout', '$rootScope', '$q', '$interpolate',
224-
/* @this */ function($scope, $exceptionHandler, $attr, $element, $parse, $animate, $timeout, $rootScope, $q, $interpolate) {
224+
/** @this */ function($scope, $exceptionHandler, $attr, $element, $parse, $animate, $timeout, $rootScope, $q, $interpolate) {
225225
this.$viewValue = Number.NaN;
226226
this.$modelValue = Number.NaN;
227227
this.$$rawModelValue = undefined; // stores the parsed modelValue / model set from scope regardless of validity.

src/ng/directive/select.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ var noopNgModelController = { $setViewValue: noop, $render: noop };
1313
* added `<option>` elements, perhaps by an `ngRepeat` directive.
1414
*/
1515
var SelectController =
16-
['$element', '$scope', /* @this */ function($element, $scope) {
16+
['$element', '$scope', /** @this */ function($element, $scope) {
1717

1818
var self = this,
1919
optionsMap = new HashMap();

src/ng/filter.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@
106106
</example>
107107
*/
108108
$FilterProvider.$inject = ['$provide'];
109-
/* @this */
109+
/** @this */
110110
function $FilterProvider($provide) {
111111
var suffix = 'Filter';
112112

src/ng/forceReflow.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
'use strict';
22

3-
var $$ForceReflowProvider = /* @this */ function() {
3+
var $$ForceReflowProvider = /** @this */ function() {
44
this.$get = ['$document', function($document) {
55
return function(domNode) {
66
//the line below will force the browser to perform a repaint so

src/ng/http.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ function serializeValue(v) {
2323
}
2424

2525

26-
/* @this */
26+
/** @this */
2727
function $HttpParamSerializerProvider() {
2828
/**
2929
* @ngdoc service
@@ -61,7 +61,7 @@ function $HttpParamSerializerProvider() {
6161
};
6262
}
6363

64-
/* @this */
64+
/** @this */
6565
function $HttpParamSerializerJQLikeProvider() {
6666
/**
6767
* @ngdoc service

src/ng/interpolate.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -331,7 +331,7 @@ function $InterpolateProvider() {
331331
expressions: expressions,
332332
$$watchDelegate: function(scope, listener) {
333333
var lastValue;
334-
return scope.$watchGroup(parseFns, /* @this */ function interpolateFnWatcher(values, oldValues) {
334+
return scope.$watchGroup(parseFns, /** @this */ function interpolateFnWatcher(values, oldValues) {
335335
var currValue = compute(values);
336336
if (isFunction(listener)) {
337337
listener.call(this, currValue, values !== oldValues ? lastValue : currValue, scope);

src/ng/interval.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
'use strict';
22

3-
/* @this */
3+
/** @this */
44
function $IntervalProvider() {
55
this.$get = ['$rootScope', '$window', '$q', '$$q', '$browser',
66
function($rootScope, $window, $q, $$q, $browser) {

src/ng/jsonpCallbacks.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
* Override this service if you wish to customise where the callbacks are stored and
1010
* how they vary compared to the requested url.
1111
*/
12-
var $jsonpCallbacksProvider = /* @this */ function() {
12+
var $jsonpCallbacksProvider = /** @this */ function() {
1313
this.$get = ['$window', function($window) {
1414
var callbacks = $window.angular.callbacks;
1515
var callbackMap = {};

src/ng/location.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -657,14 +657,14 @@ forEach([LocationHashbangInHtml5Url, LocationHashbangUrl, LocationHtml5Url], fun
657657

658658

659659
function locationGetter(property) {
660-
return /* @this */ function() {
660+
return /** @this */ function() {
661661
return this[property];
662662
};
663663
}
664664

665665

666666
function locationGetterSetter(property, preprocess) {
667-
return /* @this */ function(value) {
667+
return /** @this */ function(value) {
668668
if (isUndefined(value)) {
669669
return this[property];
670670
}

src/ng/q.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,7 @@ function $QProvider() {
254254
};
255255
}
256256

257-
/* @this */
257+
/** @this */
258258
function $$QProvider() {
259259
var errorOnUnhandledRejections = true;
260260
this.$get = ['$browser', '$exceptionHandler', function($browser, $exceptionHandler) {

src/ng/raf.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
'use strict';
22

3-
/* @this */
3+
/** @this */
44
function $$RAFProvider() { //rAF
55
this.$get = ['$window', '$timeout', function($window, $timeout) {
66
var requestAnimationFrame = $window.requestAnimationFrame ||

src/ng/testability.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
'use strict';
22

3-
/* @this */
3+
/** @this */
44
function $$TestabilityProvider() {
55
this.$get = ['$rootScope', '$browser', '$location',
66
function($rootScope, $browser, $location) {

src/ng/timeout.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
'use strict';
22

3-
/* @this */
3+
/** @this */
44
function $TimeoutProvider() {
55
this.$get = ['$rootScope', '$browser', '$q', '$$q', '$exceptionHandler',
66
function($rootScope, $browser, $q, $$q, $exceptionHandler) {

src/ngAnimate/animateCss.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -348,7 +348,7 @@ function registerRestorableStyles(backup, node, properties) {
348348
});
349349
}
350350

351-
var $AnimateCssProvider = ['$animateProvider', /* @this */ function($animateProvider) {
351+
var $AnimateCssProvider = ['$animateProvider', /** @this */ function($animateProvider) {
352352
var gcsLookup = createLocalCacheLookup();
353353
var gcsStaggerLookup = createLocalCacheLookup();
354354

src/ngAnimate/animateCssDriver.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
'use strict';
22

3-
var $$AnimateCssDriverProvider = ['$$animationProvider', /* @this */ function($$animationProvider) {
3+
var $$AnimateCssDriverProvider = ['$$animationProvider', /** @this */ function($$animationProvider) {
44
$$animationProvider.drivers.push('$$animateCssDriver');
55

66
var NG_ANIMATE_SHIM_CLASS_NAME = 'ng-animate-shim';

src/ngAnimate/animateJs.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
// TODO(matsko): add documentation
55
// by the time...
66

7-
var $$AnimateJsProvider = ['$animateProvider', /* @this */ function($animateProvider) {
7+
var $$AnimateJsProvider = ['$animateProvider', /** @this */ function($animateProvider) {
88
this.$get = ['$injector', '$$AnimateRunner', '$$jqLite',
99
function($injector, $$AnimateRunner, $$jqLite) {
1010

src/ngAnimate/animateJsDriver.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
'use strict';
22

3-
var $$AnimateJsDriverProvider = ['$$animationProvider', /* @this */ function($$animationProvider) {
3+
var $$AnimateJsDriverProvider = ['$$animationProvider', /** @this */ function($$animationProvider) {
44
$$animationProvider.drivers.push('$$animateJsDriver');
55
this.$get = ['$$animateJs', '$$AnimateRunner', function($$animateJs, $$AnimateRunner) {
66
return function initDriverFn(animationDetails) {

src/ngAnimate/animateQueue.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
var NG_ANIMATE_ATTR_NAME = 'data-ng-animate';
44
var NG_ANIMATE_PIN_DATA = '$ngAnimatePin';
5-
var $$AnimateQueueProvider = ['$animateProvider', /* @this */ function($animateProvider) {
5+
var $$AnimateQueueProvider = ['$animateProvider', /** @this */ function($animateProvider) {
66
var PRE_DIGEST_STATE = 1;
77
var RUNNING_STATE = 2;
88
var ONE_SPACE = ' ';
@@ -176,7 +176,7 @@ var $$AnimateQueueProvider = ['$animateProvider', /* @this */ function($animateP
176176
}
177177

178178
// IE9-11 has no method "contains" in SVG element and in Node.prototype. Bug #10259.
179-
var contains = window.Node.prototype.contains || /* @this */ function(arg) {
179+
var contains = window.Node.prototype.contains || /** @this */ function(arg) {
180180
// eslint-disable-next-line no-bitwise
181181
return this === arg || !!(this.compareDocumentPosition(arg) & 16);
182182
};

src/ngAnimate/animation.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
/* exported $$AnimationProvider */
44

5-
var $$AnimationProvider = ['$animateProvider', /* @this */ function($animateProvider) {
5+
var $$AnimationProvider = ['$animateProvider', /** @this */ function($animateProvider) {
66
var NG_ANIMATE_REF_ATTR = 'ng-animate-ref';
77

88
var drivers = this.drivers = [];

src/ngCookies/cookieWriter.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,6 @@ function $$CookieWriter($document, $log, $browser) {
5555

5656
$$CookieWriter.$inject = ['$document', '$log', '$browser'];
5757

58-
angular.module('ngCookies').provider('$$cookieWriter', /* @this */ function $$CookieWriterProvider() {
58+
angular.module('ngCookies').provider('$$cookieWriter', /** @this */ function $$CookieWriterProvider() {
5959
this.$get = $$CookieWriter;
6060
});

src/ngCookies/cookies.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ angular.module('ngCookies', ['ng']).
2323
* @description
2424
* Use `$cookiesProvider` to change the default behavior of the {@link ngCookies.$cookies $cookies} service.
2525
* */
26-
provider('$cookies', [/* @this */function $CookiesProvider() {
26+
provider('$cookies', [/** @this */function $CookiesProvider() {
2727
/**
2828
* @ngdoc property
2929
* @name $cookiesProvider#defaults

src/ngMock/angular-mocks.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -2874,7 +2874,7 @@ angular.mock.$RootScopeDecorator = ['$delegate', function($delegate) {
28742874

28752875
var initialized = false;
28762876

2877-
module.$$beforeAllHook(/* @this */ function() {
2877+
module.$$beforeAllHook(/** @this */ function() {
28782878
if (injectorState.shared) {
28792879
injectorState.sharedError = Error("sharedInjector() cannot be called inside a context that has already called sharedInjector()");
28802880
throw injectorState.sharedError;

0 commit comments

Comments
 (0)