diff --git a/docs/app/src/search.js b/docs/app/src/search.js index 5a49b11bc104..79bae064fdd9 100644 --- a/docs/app/src/search.js +++ b/docs/app/src/search.js @@ -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}); diff --git a/docs/config/index.js b/docs/config/index.js index ad43a442121e..d0716012ad1c 100644 --- a/docs/config/index.js +++ b/docs/config/index.js @@ -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')); }) diff --git a/docs/config/tag-defs/this.js b/docs/config/tag-defs/this.js new file mode 100644 index 000000000000..60ec4ed4f7f6 --- /dev/null +++ b/docs/config/tag-defs/this.js @@ -0,0 +1,5 @@ +'use strict'; + +module.exports = { + name: 'this' +}; diff --git a/docs/gulpfile.js b/docs/gulpfile.js index 67cdd922c249..424601e64552 100644 --- a/docs/gulpfile.js +++ b/docs/gulpfile.js @@ -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', diff --git a/src/apis.js b/src/apis.js index d9bd34f90de5..457eb9d1c9b4 100644 --- a/src/apis.js +++ b/src/apis.js @@ -74,7 +74,7 @@ HashMap.prototype = { } }; -var $$HashMapProvider = [/* @this */function() { +var $$HashMapProvider = [/** @this */function() { this.$get = [function() { return HashMap; }]; diff --git a/src/auto/injector.js b/src/auto/injector.js index 352561afa4d9..1b00ecc13705 100644 --- a/src/auto/injector.js +++ b/src/auto/injector.js @@ -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); diff --git a/src/jqLite.js b/src/jqLite.js index f3ae97e6be38..54d42b033d41 100644 --- a/src/jqLite.js +++ b/src/jqLite.js @@ -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); }; @@ -1068,7 +1068,7 @@ forEach({ // Provider for private $$jqLite service -/* @this */ +/** @this */ function $$jqLiteProvider() { this.$get = function $$jqLite() { return extend(JQLite, { diff --git a/src/ng/animate.js b/src/ng/animate.js index 207933928c6d..06c706e7c12b 100644 --- a/src/ng/animate.js +++ b/src/ng/animate.js @@ -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 = []; @@ -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); diff --git a/src/ng/animateRunner.js b/src/ng/animateRunner.js index 5b0d6615cdec..70dcf72e8e37 100644 --- a/src/ng/animateRunner.js +++ b/src/ng/animateRunner.js @@ -1,6 +1,6 @@ 'use strict'; -var $$AnimateAsyncRunFactoryProvider = /* @this */ function() { +var $$AnimateAsyncRunFactoryProvider = /** @this */ function() { this.$get = ['$$rAF', function($$rAF) { var waitQueue = []; @@ -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) { diff --git a/src/ng/browser.js b/src/ng/browser.js index c5102fd28a8a..ebed151bbcd6 100644 --- a/src/ng/browser.js +++ b/src/ng/browser.js @@ -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) { diff --git a/src/ng/compile.js b/src/ng/compile.js index f5b0d450edea..5c0385679360 100644 --- a/src/ng/compile.js +++ b/src/ng/compile.js @@ -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', @@ -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 { @@ -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); diff --git a/src/ng/cookieReader.js b/src/ng/cookieReader.js index 85bc165d1f6c..c1c4447a0146 100644 --- a/src/ng/cookieReader.js +++ b/src/ng/cookieReader.js @@ -51,7 +51,7 @@ function $$CookieReader($document) { $$CookieReader.$inject = ['$document']; -/* @this */ +/** @this */ function $$CookieReaderProvider() { this.$get = $$CookieReader; } diff --git a/src/ng/directive/input.js b/src/ng/directive/input.js index 1658dc5580e6..ffc178e46dac 100644 --- a/src/ng/directive/input.js +++ b/src/ng/directive/input.js @@ -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 @@ -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; diff --git a/src/ng/directive/ngModel.js b/src/ng/directive/ngModel.js index d559d45cd05c..9dc344519de4 100644 --- a/src/ng/directive/ngModel.js +++ b/src/ng/directive/ngModel.js @@ -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. diff --git a/src/ng/directive/select.js b/src/ng/directive/select.js index dc0621de60b0..cae1184e2b0b 100644 --- a/src/ng/directive/select.js +++ b/src/ng/directive/select.js @@ -13,7 +13,7 @@ var noopNgModelController = { $setViewValue: noop, $render: noop }; * added `