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

chore(package): fix some warnings/errors #14997

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/app/src/search.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ angular.module('search', [])
}

// Create the lunr index
var index = lunr(/* @this */ function() {
var index = lunr(/** @this */ function() {
this.ref('path');
this.field('titleWords', {boost: 50});
this.field('members', { boost: 40});
Expand Down
1 change: 1 addition & 0 deletions docs/config/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ module.exports = new Package('angularjs', [
parseTagsProcessor.tagDefinitions.push(require('./tag-defs/tutorial-step'));
parseTagsProcessor.tagDefinitions.push(require('./tag-defs/sortOrder'));
parseTagsProcessor.tagDefinitions.push(require('./tag-defs/installation'));
parseTagsProcessor.tagDefinitions.push(require('./tag-defs/this'));
})


Expand Down
5 changes: 5 additions & 0 deletions docs/config/tag-defs/this.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
'use strict';

module.exports = {
name: 'this'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ignore: true I think additional bonus points!

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried adding that and I get a ton of warnings like:

warn:    Missing container document: "$anchorScrollProvider" - doc "$anchorScrollProvider#method:disableAutoScrolling" (method)  - from file "ng/anchorScroll.js" - starting at line 16, ending at line 28
warn:    Missing container document: "$cacheFactory" - doc "$cacheFactory#method:info" (method)  - from file "ng/cacheFactory.js" - starting at line 320, ending at line 328
...
warn:    Missing service "module:ng.service:$anchorScrollProvider
@this" for provider - doc "module:ng.provider:$anchorScrollProvider
@this" (provider)  - from file "ng/anchorScroll.js" - starting at line 3, ending at line 11
warn:    Missing service "module:ng.service:$controllerProvider
@this" for provider - doc "module:ng.provider:$controllerProvider
@this" (provider)  - from file "ng/controller.js" - starting at line 16, ending at line 27
...
warn:    Invalid link (does not match any doc): "ngRoute.$routeProvider" - doc "index" (overview)  - from file "api/index.ngdoc" - starting at line 1
warn:    Invalid link (does not match any doc): "ngAria.$ariaProvider" - doc "index" (overview)  - from file "api/index.ngdoc" - starting at line 1
...

And also couple of errors at the end:

error:   Error: ENOENT: no such file or directory, open 'C:\Datafiles\Dev\AngularJS\angular.js\build\docs\partials\api\ng\provider\$anchorScrollProvider
@this.html'
    at Error (native)
error:   Error processing docs:  Error: ENOENT: no such file or directory, open 'C:\Datafiles\Dev\AngularJS\angular.js\build\docs\partials\api\ng\provider\$anchorScrollProvider
@this.html'
    at Error (native)

Thoughts?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For future reference, @petebacondarwin said:

If a tag is ignored then it appears verbatim inside the content of the previous tag
So the following:

 * @ngdoc provider
 * @name $anchorScrollProvider
 * @this
 * @description ...

Meant that the name of the doc was $anchorScrollProvider\n@this
Happy to leave the ignore: true out

};
2 changes: 2 additions & 0 deletions docs/gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ var getMergedEslintConfig = function(filepath) {
strict: 'off',
// Generated examples may miss the final EOL; ignore that.
'eol-last': 'off',
// Generated files use the system's default linebreak style (i.e. CRLF on Windows)
'linebreak-style': 'off',
// While alerts would be bad to have in the library or test code,
// they're perfectly fine in examples.
'no-alert': 'off',
Expand Down
2 changes: 1 addition & 1 deletion src/apis.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ HashMap.prototype = {
}
};

var $$HashMapProvider = [/* @this */function() {
var $$HashMapProvider = [/** @this */function() {
this.$get = [function() {
return HashMap;
}];
Expand Down
2 changes: 1 addition & 1 deletion src/auto/injector.js
Original file line number Diff line number Diff line change
Expand Up @@ -710,7 +710,7 @@ function createInjector(modulesToLoad, strictDi) {
}

function enforceReturnValue(name, factory) {
return /* @this */ function enforcedReturnValue() {
return /** @this */ function enforcedReturnValue() {
var result = instanceInjector.invoke(factory, this);
if (isUndefined(result)) {
throw $injectorMinErr('undef', "Provider '{0}' must return a value from $get factory method.", name);
Expand Down
4 changes: 2 additions & 2 deletions src/jqLite.js
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ function jqLiteWrapNode(node, wrapper) {


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


// Provider for private $$jqLite service
/* @this */
/** @this */
function $$jqLiteProvider() {
this.$get = function $$jqLite() {
return extend(JQLite, {
Expand Down
6 changes: 3 additions & 3 deletions src/ng/animate.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,13 +53,13 @@ function prepareAnimateOptions(options) {
: {};
}

var $$CoreAnimateJsProvider = /* @this */ function() {
var $$CoreAnimateJsProvider = /** @this */ function() {
this.$get = noop;
};

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

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

this.$$registeredAnimations = Object.create(null);
Expand Down
4 changes: 2 additions & 2 deletions src/ng/animateRunner.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use strict';

var $$AnimateAsyncRunFactoryProvider = /* @this */ function() {
var $$AnimateAsyncRunFactoryProvider = /** @this */ function() {
this.$get = ['$$rAF', function($$rAF) {
var waitQueue = [];

Expand Down Expand Up @@ -31,7 +31,7 @@ var $$AnimateAsyncRunFactoryProvider = /* @this */ function() {
}];
};

var $$AnimateRunnerFactoryProvider = /* @this */ function() {
var $$AnimateRunnerFactoryProvider = /** @this */ function() {
this.$get = ['$q', '$sniffer', '$$animateAsyncRun', '$$isDocumentHidden', '$timeout',
function($q, $sniffer, $$animateAsyncRun, $$isDocumentHidden, $timeout) {

Expand Down
2 changes: 1 addition & 1 deletion src/ng/browser.js
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,7 @@ function Browser(window, document, $log, $sniffer) {

}

/* @this */
/** @this */
function $BrowserProvider() {
this.$get = ['$window', '$log', '$sniffer', '$document',
function($window, $log, $sniffer, $document) {
Expand Down
6 changes: 3 additions & 3 deletions src/ng/compile.js
Original file line number Diff line number Diff line change
Expand Up @@ -958,7 +958,7 @@ var _UNINITIALIZED_VALUE = new UNINITIALIZED_VALUE();
* @description
*/
$CompileProvider.$inject = ['$provide', '$$sanitizeUriProvider'];
/* @this */
/** @this */
function $CompileProvider($provide, $$sanitizeUriProvider) {
var hasDirectives = {},
Suffix = 'Directive',
Expand Down Expand Up @@ -1217,7 +1217,7 @@ function $CompileProvider($provide, $$sanitizeUriProvider) {
function factory($injector) {
function makeInjectable(fn) {
if (isFunction(fn) || isArray(fn)) {
return /* @this */ function(tElement, tAttrs) {
return /** @this */ function(tElement, tAttrs) {
return $injector.invoke(fn, this, {$element: tElement, $attrs: tAttrs});
};
} else {
Expand Down Expand Up @@ -2146,7 +2146,7 @@ function $CompileProvider($provide, $$sanitizeUriProvider) {
if (eager) {
return compile($compileNodes, transcludeFn, maxPriority, ignoreDirective, previousCompileContext);
}
return /* @this */ function lazyCompilation() {
return /** @this */ function lazyCompilation() {
if (!compiled) {
compiled = compile($compileNodes, transcludeFn, maxPriority, ignoreDirective, previousCompileContext);

Expand Down
2 changes: 1 addition & 1 deletion src/ng/cookieReader.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ function $$CookieReader($document) {

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

/* @this */
/** @this */
function $$CookieReaderProvider() {
this.$get = $$CookieReader;
}
4 changes: 2 additions & 2 deletions src/ng/directive/input.js
Original file line number Diff line number Diff line change
Expand Up @@ -1271,7 +1271,7 @@ function baseInputType(scope, element, attr, ctrl, $sniffer, $browser) {
}
};

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

// ignore
Expand All @@ -1296,7 +1296,7 @@ function baseInputType(scope, element, attr, ctrl, $sniffer, $browser) {
// For these event types, when native validators are present and the browser supports the type,
// check for validity changes on various DOM events.
if (PARTIAL_VALIDATION_TYPES[type] && ctrl.$$hasNativeValidators && type === attr.type) {
element.on(PARTIAL_VALIDATION_EVENTS, /* @this */ function(ev) {
element.on(PARTIAL_VALIDATION_EVENTS, /** @this */ function(ev) {
if (!timeout) {
var validity = this[VALIDITY_STATE_PROPERTY];
var origBadInput = validity.badInput;
Expand Down
2 changes: 1 addition & 1 deletion src/ng/directive/ngModel.js
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ is set to `true`. The parse error is stored in `ngModel.$error.parse`.
*
*/
var NgModelController = ['$scope', '$exceptionHandler', '$attrs', '$element', '$parse', '$animate', '$timeout', '$rootScope', '$q', '$interpolate',
/* @this */ function($scope, $exceptionHandler, $attr, $element, $parse, $animate, $timeout, $rootScope, $q, $interpolate) {
/** @this */ function($scope, $exceptionHandler, $attr, $element, $parse, $animate, $timeout, $rootScope, $q, $interpolate) {
this.$viewValue = Number.NaN;
this.$modelValue = Number.NaN;
this.$$rawModelValue = undefined; // stores the parsed modelValue / model set from scope regardless of validity.
Expand Down
2 changes: 1 addition & 1 deletion src/ng/directive/select.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ var noopNgModelController = { $setViewValue: noop, $render: noop };
* added `<option>` elements, perhaps by an `ngRepeat` directive.
*/
var SelectController =
['$element', '$scope', /* @this */ function($element, $scope) {
['$element', '$scope', /** @this */ function($element, $scope) {

var self = this,
optionsMap = new HashMap();
Expand Down
2 changes: 1 addition & 1 deletion src/ng/filter.js
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@
</example>
*/
$FilterProvider.$inject = ['$provide'];
/* @this */
/** @this */
function $FilterProvider($provide) {
var suffix = 'Filter';

Expand Down
2 changes: 1 addition & 1 deletion src/ng/forceReflow.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use strict';

var $$ForceReflowProvider = /* @this */ function() {
var $$ForceReflowProvider = /** @this */ function() {
this.$get = ['$document', function($document) {
return function(domNode) {
//the line below will force the browser to perform a repaint so
Expand Down
4 changes: 2 additions & 2 deletions src/ng/http.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ function serializeValue(v) {
}


/* @this */
/** @this */
function $HttpParamSerializerProvider() {
/**
* @ngdoc service
Expand Down Expand Up @@ -61,7 +61,7 @@ function $HttpParamSerializerProvider() {
};
}

/* @this */
/** @this */
function $HttpParamSerializerJQLikeProvider() {
/**
* @ngdoc service
Expand Down
2 changes: 1 addition & 1 deletion src/ng/interpolate.js
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,7 @@ function $InterpolateProvider() {
expressions: expressions,
$$watchDelegate: function(scope, listener) {
var lastValue;
return scope.$watchGroup(parseFns, /* @this */ function interpolateFnWatcher(values, oldValues) {
return scope.$watchGroup(parseFns, /** @this */ function interpolateFnWatcher(values, oldValues) {
var currValue = compute(values);
if (isFunction(listener)) {
listener.call(this, currValue, values !== oldValues ? lastValue : currValue, scope);
Expand Down
2 changes: 1 addition & 1 deletion src/ng/interval.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use strict';

/* @this */
/** @this */
function $IntervalProvider() {
this.$get = ['$rootScope', '$window', '$q', '$$q', '$browser',
function($rootScope, $window, $q, $$q, $browser) {
Expand Down
2 changes: 1 addition & 1 deletion src/ng/jsonpCallbacks.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
* Override this service if you wish to customise where the callbacks are stored and
* how they vary compared to the requested url.
*/
var $jsonpCallbacksProvider = /* @this */ function() {
var $jsonpCallbacksProvider = /** @this */ function() {
this.$get = ['$window', function($window) {
var callbacks = $window.angular.callbacks;
var callbackMap = {};
Expand Down
4 changes: 2 additions & 2 deletions src/ng/location.js
Original file line number Diff line number Diff line change
Expand Up @@ -657,14 +657,14 @@ forEach([LocationHashbangInHtml5Url, LocationHashbangUrl, LocationHtml5Url], fun


function locationGetter(property) {
return /* @this */ function() {
return /** @this */ function() {
return this[property];
};
}


function locationGetterSetter(property, preprocess) {
return /* @this */ function(value) {
return /** @this */ function(value) {
if (isUndefined(value)) {
return this[property];
}
Expand Down
2 changes: 1 addition & 1 deletion src/ng/q.js
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ function $QProvider() {
};
}

/* @this */
/** @this */
function $$QProvider() {
var errorOnUnhandledRejections = true;
this.$get = ['$browser', '$exceptionHandler', function($browser, $exceptionHandler) {
Expand Down
2 changes: 1 addition & 1 deletion src/ng/raf.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use strict';

/* @this */
/** @this */
function $$RAFProvider() { //rAF
this.$get = ['$window', '$timeout', function($window, $timeout) {
var requestAnimationFrame = $window.requestAnimationFrame ||
Expand Down
2 changes: 1 addition & 1 deletion src/ng/testability.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use strict';

/* @this */
/** @this */
function $$TestabilityProvider() {
this.$get = ['$rootScope', '$browser', '$location',
function($rootScope, $browser, $location) {
Expand Down
2 changes: 1 addition & 1 deletion src/ng/timeout.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use strict';

/* @this */
/** @this */
function $TimeoutProvider() {
this.$get = ['$rootScope', '$browser', '$q', '$$q', '$exceptionHandler',
function($rootScope, $browser, $q, $$q, $exceptionHandler) {
Expand Down
2 changes: 1 addition & 1 deletion src/ngAnimate/animateCss.js
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,7 @@ function registerRestorableStyles(backup, node, properties) {
});
}

var $AnimateCssProvider = ['$animateProvider', /* @this */ function($animateProvider) {
var $AnimateCssProvider = ['$animateProvider', /** @this */ function($animateProvider) {
var gcsLookup = createLocalCacheLookup();
var gcsStaggerLookup = createLocalCacheLookup();

Expand Down
2 changes: 1 addition & 1 deletion src/ngAnimate/animateCssDriver.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use strict';

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

var NG_ANIMATE_SHIM_CLASS_NAME = 'ng-animate-shim';
Expand Down
2 changes: 1 addition & 1 deletion src/ngAnimate/animateJs.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
// TODO(matsko): add documentation
// by the time...

var $$AnimateJsProvider = ['$animateProvider', /* @this */ function($animateProvider) {
var $$AnimateJsProvider = ['$animateProvider', /** @this */ function($animateProvider) {
this.$get = ['$injector', '$$AnimateRunner', '$$jqLite',
function($injector, $$AnimateRunner, $$jqLite) {

Expand Down
2 changes: 1 addition & 1 deletion src/ngAnimate/animateJsDriver.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use strict';

var $$AnimateJsDriverProvider = ['$$animationProvider', /* @this */ function($$animationProvider) {
var $$AnimateJsDriverProvider = ['$$animationProvider', /** @this */ function($$animationProvider) {
$$animationProvider.drivers.push('$$animateJsDriver');
this.$get = ['$$animateJs', '$$AnimateRunner', function($$animateJs, $$AnimateRunner) {
return function initDriverFn(animationDetails) {
Expand Down
4 changes: 2 additions & 2 deletions src/ngAnimate/animateQueue.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

var NG_ANIMATE_ATTR_NAME = 'data-ng-animate';
var NG_ANIMATE_PIN_DATA = '$ngAnimatePin';
var $$AnimateQueueProvider = ['$animateProvider', /* @this */ function($animateProvider) {
var $$AnimateQueueProvider = ['$animateProvider', /** @this */ function($animateProvider) {
var PRE_DIGEST_STATE = 1;
var RUNNING_STATE = 2;
var ONE_SPACE = ' ';
Expand Down Expand Up @@ -176,7 +176,7 @@ var $$AnimateQueueProvider = ['$animateProvider', /* @this */ function($animateP
}

// IE9-11 has no method "contains" in SVG element and in Node.prototype. Bug #10259.
var contains = window.Node.prototype.contains || /* @this */ function(arg) {
var contains = window.Node.prototype.contains || /** @this */ function(arg) {
// eslint-disable-next-line no-bitwise
return this === arg || !!(this.compareDocumentPosition(arg) & 16);
};
Expand Down
2 changes: 1 addition & 1 deletion src/ngAnimate/animation.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

/* exported $$AnimationProvider */

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

var drivers = this.drivers = [];
Expand Down
2 changes: 1 addition & 1 deletion src/ngCookies/cookieWriter.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,6 @@ function $$CookieWriter($document, $log, $browser) {

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

angular.module('ngCookies').provider('$$cookieWriter', /* @this */ function $$CookieWriterProvider() {
angular.module('ngCookies').provider('$$cookieWriter', /** @this */ function $$CookieWriterProvider() {
this.$get = $$CookieWriter;
});
2 changes: 1 addition & 1 deletion src/ngCookies/cookies.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ angular.module('ngCookies', ['ng']).
* @description
* Use `$cookiesProvider` to change the default behavior of the {@link ngCookies.$cookies $cookies} service.
* */
provider('$cookies', [/* @this */function $CookiesProvider() {
provider('$cookies', [/** @this */function $CookiesProvider() {
/**
* @ngdoc property
* @name $cookiesProvider#defaults
Expand Down
2 changes: 1 addition & 1 deletion src/ngMock/angular-mocks.js
Original file line number Diff line number Diff line change
Expand Up @@ -2874,7 +2874,7 @@ angular.mock.$RootScopeDecorator = ['$delegate', function($delegate) {

var initialized = false;

module.$$beforeAllHook(/* @this */ function() {
module.$$beforeAllHook(/** @this */ function() {
if (injectorState.shared) {
injectorState.sharedError = Error("sharedInjector() cannot be called inside a context that has already called sharedInjector()");
throw injectorState.sharedError;
Expand Down
Loading