From 94718cb87d016d21e71fd6fc921423bf33a7a29d Mon Sep 17 00:00:00 2001 From: Ben McCann Date: Sat, 15 Dec 2012 16:09:12 -0800 Subject: [PATCH 01/36] Replace reserved word int with atoi. Helpful for compiling with Closure Compiler advanced optimizations --- src/Angular.js | 4 ++-- src/ng/directive/input.js | 4 ++-- src/ng/filter/filters.js | 10 +++++----- src/ng/filter/limitTo.js | 2 +- src/ng/http.js | 4 ++-- src/ng/location.js | 2 +- src/ng/sniffer.js | 2 +- src/ngMock/angular-mocks.js | 10 +++++----- 8 files changed, 19 insertions(+), 19 deletions(-) diff --git a/src/Angular.js b/src/Angular.js index 3a11f3ea7188..ba6995a99d33 100644 --- a/src/Angular.js +++ b/src/Angular.js @@ -51,7 +51,7 @@ function fromCharCode(code) {return String.fromCharCode(code);} var Error = window.Error, /** holds major version number for IE or NaN for real browsers */ - msie = int((/msie (\d+)/.exec(lowercase(navigator.userAgent)) || [])[1]), + msie = atoi((/msie (\d+)/.exec(lowercase(navigator.userAgent)) || [])[1]), jqLite, // delay binding since jQuery could be loaded after us. jQuery, // delay binding slice = [].slice, @@ -197,7 +197,7 @@ function extend(dst) { return dst; } -function int(str) { +function atoi(str) { return parseInt(str, 10); } diff --git a/src/ng/directive/input.js b/src/ng/directive/input.js index aaabd1033398..e675fdfd090a 100644 --- a/src/ng/directive/input.js +++ b/src/ng/directive/input.js @@ -474,7 +474,7 @@ function textInputType(scope, element, attr, ctrl, $sniffer, $browser) { // min length validator if (attr.ngMinlength) { - var minlength = int(attr.ngMinlength); + var minlength = atoi(attr.ngMinlength); var minLengthValidator = function(value) { if (!isEmpty(value) && value.length < minlength) { ctrl.$setValidity('minlength', false); @@ -491,7 +491,7 @@ function textInputType(scope, element, attr, ctrl, $sniffer, $browser) { // max length validator if (attr.ngMaxlength) { - var maxlength = int(attr.ngMaxlength); + var maxlength = atoi(attr.ngMaxlength); var maxLengthValidator = function(value) { if (!isEmpty(value) && value.length > maxlength) { ctrl.$setValidity('maxlength', false); diff --git a/src/ng/filter/filters.js b/src/ng/filter/filters.js index 57186981f075..de8a4ebc78d7 100644 --- a/src/ng/filter/filters.js +++ b/src/ng/filter/filters.js @@ -337,11 +337,11 @@ function dateFilter($locale) { tzHour = 0, tzMin = 0; if (match[9]) { - tzHour = int(match[9] + match[10]); - tzMin = int(match[9] + match[11]); + tzHour = atoi(match[9] + match[10]); + tzMin = atoi(match[9] + match[11]); } - date.setUTCFullYear(int(match[1]), int(match[2]) - 1, int(match[3])); - date.setUTCHours(int(match[4]||0) - tzHour, int(match[5]||0) - tzMin, int(match[6]||0), int(match[7]||0)); + date.setUTCFullYear(atoi(match[1]), atoi(match[2]) - 1, atoi(match[3])); + date.setUTCHours(atoi(match[4]||0) - tzHour, atoi(match[5]||0) - tzMin, atoi(match[6]||0), atoi(match[7]||0)); return date; } return string; @@ -357,7 +357,7 @@ function dateFilter($locale) { format = $locale.DATETIME_FORMATS[format] || format; if (isString(date)) { if (NUMBER_STRING.test(date)) { - date = int(date); + date = atoi(date); } else { date = jsonStringToDate(date); } diff --git a/src/ng/filter/limitTo.js b/src/ng/filter/limitTo.js index 536c703868d0..ab6b4c768fc4 100644 --- a/src/ng/filter/limitTo.js +++ b/src/ng/filter/limitTo.js @@ -56,7 +56,7 @@ function limitToFilter(){ return function(array, limit) { if (!(array instanceof Array)) return array; - limit = int(limit); + limit = atoi(limit); var out = [], i, n; diff --git a/src/ng/http.js b/src/ng/http.js index d840c78b620c..a3c7d4a0def2 100644 --- a/src/ng/http.js +++ b/src/ng/http.js @@ -47,7 +47,7 @@ function isSameDomain(requestUrl, locationUrl) { var domain1 = { protocol: match[2], host: match[4], - port: int(match[6]) || DEFAULT_PORTS[match[2]] || null, + port: atoi(match[6]) || DEFAULT_PORTS[match[2]] || null, // IE8 sets unmatched groups to '' instead of undefined. relativeProtocol: match[2] === undefined || match[2] === '' }; @@ -56,7 +56,7 @@ function isSameDomain(requestUrl, locationUrl) { var domain2 = { protocol: match[1], host: match[3], - port: int(match[5]) || DEFAULT_PORTS[match[1]] || null + port: atoi(match[5]) || DEFAULT_PORTS[match[1]] || null }; return (domain1.protocol == domain2.protocol || domain1.relativeProtocol) && diff --git a/src/ng/location.js b/src/ng/location.js index 73ef7f7b1db7..19ebaf6d401e 100644 --- a/src/ng/location.js +++ b/src/ng/location.js @@ -34,7 +34,7 @@ function matchUrl(url, obj) { match = { protocol: match[1], host: match[3], - port: int(match[5]) || DEFAULT_PORTS[match[1]] || null, + port: atoi(match[5]) || DEFAULT_PORTS[match[1]] || null, path: match[6] || '/', search: match[8], hash: match[10] diff --git a/src/ng/sniffer.js b/src/ng/sniffer.js index 9342fbd51b57..cb91aff15ced 100644 --- a/src/ng/sniffer.js +++ b/src/ng/sniffer.js @@ -16,7 +16,7 @@ function $SnifferProvider() { this.$get = ['$window', '$document', function($window, $document) { var eventSupport = {}, - android = int((/android (\d+)/.exec(lowercase($window.navigator.userAgent)) || [])[1]), + android = atoi((/android (\d+)/.exec(lowercase($window.navigator.userAgent)) || [])[1]), document = $document[0]; return { diff --git a/src/ngMock/angular-mocks.js b/src/ngMock/angular-mocks.js index 647a01fe38b2..b685b192be98 100644 --- a/src/ngMock/angular-mocks.js +++ b/src/ngMock/angular-mocks.js @@ -371,17 +371,17 @@ angular.mock.$LogProvider = function() { tzHour = 0, tzMin = 0; if (match[9]) { - tzHour = int(match[9] + match[10]); - tzMin = int(match[9] + match[11]); + tzHour = atoi(match[9] + match[10]); + tzMin = atoi(match[9] + match[11]); } - date.setUTCFullYear(int(match[1]), int(match[2]) - 1, int(match[3])); - date.setUTCHours(int(match[4]||0) - tzHour, int(match[5]||0) - tzMin, int(match[6]||0), int(match[7]||0)); + date.setUTCFullYear(atoi(match[1]), atoi(match[2]) - 1, atoi(match[3])); + date.setUTCHours(atoi(match[4]||0) - tzHour, atoi(match[5]||0) - tzMin, atoi(match[6]||0), atoi(match[7]||0)); return date; } return string; } - function int(str) { + function atoi(str) { return parseInt(str, 10); } From f7f259f06199d91f3080ce00f94f20fc4c3f69df Mon Sep 17 00:00:00 2001 From: Ben McCann Date: Sat, 15 Dec 2012 18:04:52 -0800 Subject: [PATCH 02/36] Fix bad array type annotations --- src/Angular.js | 2 +- src/ngScenario/Describe.js | 2 +- src/ngScenario/ObjectModel.js | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Angular.js b/src/Angular.js index ba6995a99d33..9004536b9be4 100644 --- a/src/Angular.js +++ b/src/Angular.js @@ -908,7 +908,7 @@ function angularInit(element, bootstrap) { * See: {@link guide/bootstrap Bootstrap} * * @param {Element} element DOM element which is the root of angular application. - * @param {Array=} modules an array of module declarations. See: {@link angular.module modules} + * @param {Array.=} modules an array of module declarations. See: {@link angular.module modules} * @returns {AUTO.$injector} Returns the newly created injector for this app. */ function bootstrap(element, modules) { diff --git a/src/ngScenario/Describe.js b/src/ngScenario/Describe.js index 4d52e9d58486..d2acdf71e436 100644 --- a/src/ngScenario/Describe.js +++ b/src/ngScenario/Describe.js @@ -128,7 +128,7 @@ angular.scenario.Describe.prototype.xit = angular.noop; * Gets an array of functions representing all the tests (recursively). * that can be executed with SpecRunner's. * - * @return {Array} Array of it blocks { + * @return {Array.} Array of it blocks { * definition : Object // parent Describe * only: boolean * name: string diff --git a/src/ngScenario/ObjectModel.js b/src/ngScenario/ObjectModel.js index 9c6ce56c23f4..f4b17b25a4cd 100644 --- a/src/ngScenario/ObjectModel.js +++ b/src/ngScenario/ObjectModel.js @@ -155,7 +155,7 @@ angular.scenario.ObjectModel.prototype.emit = function(eventName) { * this spec. * * @param spec Spec to compute the path for. - * @return {Array} The describe block path + * @return {Array.} The describe block path */ angular.scenario.ObjectModel.prototype.getDefinitionPath = function(spec) { var path = []; @@ -182,7 +182,7 @@ angular.scenario.ObjectModel.prototype.getSpec = function(id) { * * @param {string} id Id of the spec * @param {string} name Name of the spec - * @param {Array=} definitionNames List of all describe block names that wrap this spec + * @param {Array.=} definitionNames List of all describe block names that wrap this spec */ angular.scenario.ObjectModel.Spec = function(id, name, definitionNames) { this.id = id; From a488062d34878ae51e012dec7a3ec685b4b6d927 Mon Sep 17 00:00:00 2001 From: Ben McCann Date: Sat, 15 Dec 2012 18:48:56 -0800 Subject: [PATCH 03/36] Fix jsdocs that refer to non-existing parameters --- src/Angular.js | 23 +++++++++++------------ src/loader.js | 2 +- src/ng/browser.js | 7 +++---- src/ng/compile.js | 2 +- src/ng/rootScope.js | 16 +++++----------- 5 files changed, 21 insertions(+), 29 deletions(-) diff --git a/src/Angular.js b/src/Angular.js index 9004536b9be4..1383134befe6 100644 --- a/src/Angular.js +++ b/src/Angular.js @@ -184,7 +184,6 @@ function nextUid() { * to `dst`. You can specify multiple `src` objects. * * @param {Object} dst Destination object. - * @param {...Object} src Source object(s). */ function extend(dst) { forEach(arguments, function(obj){ @@ -403,7 +402,7 @@ function trim(value) { * @description * Determines if a reference is a DOM element (or wrapped jQuery element). * - * @param {*} value Reference to check. + * @param {*} node Reference to check. * @returns {boolean} True if `value` is a DOM element (or wrapped jQuery element). */ function isElement(node) { @@ -647,32 +646,32 @@ function sliceArgs(args, startIndex) { /** - * @ngdoc function + * * @name angular.bind * @function * * @description * Returns a function which calls function `fn` bound to `self` (`self` becomes the `this` for - * `fn`). You can supply optional `args` that are are prebound to the function. This feature is also + * `fn`). You can supply optional `var_args` that are are prebound to the function. This feature is also * known as [function currying](http://en.wikipedia.org/wiki/Currying). * * @param {Object} self Context which `fn` should be evaluated in. * @param {function()} fn Function to be bound. - * @param {...*} args Optional arguments to be prebound to the `fn` function call. + * @param {...*} var_args Optional arguments to be prebound to the `fn` function call. * @returns {function()} Function that wraps the `fn` with all the specified bindings. */ -function bind(self, fn) { - var curryArgs = arguments.length > 2 ? sliceArgs(arguments, 2) : []; +function bind(self, fn, var_args) { + var curryArgs = var_args.length > 2 ? sliceArgs(var_args, 2) : []; if (isFunction(fn) && !(fn instanceof RegExp)) { return curryArgs.length ? function() { - return arguments.length - ? fn.apply(self, curryArgs.concat(slice.call(arguments, 0))) + return var_args.length + ? fn.apply(self, curryArgs.concat(slice.call(var_args, 0))) : fn.apply(self, curryArgs); } : function() { - return arguments.length - ? fn.apply(self, arguments) + return var_args.length + ? fn.apply(self, var_args) : fn.call(self); }; } else { @@ -832,7 +831,7 @@ function encodeUriQuery(val, pctEncodeSpaces) { * @name ng.directive:ngApp * * @element ANY - * @param {angular.Module} ngApp an optional application + * @param {angular.Module} bootstrap an optional application * {@link angular.module module} name to load. * * @description diff --git a/src/loader.js b/src/loader.js index ecb166085460..9e39d161cb99 100644 --- a/src/loader.js +++ b/src/loader.js @@ -212,7 +212,7 @@ function setupModuleLoader(window) { * @ngdoc method * @name angular.Module#run * @methodOf angular.Module - * @param {Function} initializationFn Execute this function after injector creation. + * @param {Function} block Execute this function after injector creation. * Useful for application initialization. * @description * Use this method to register work which should be performed when the injector is done diff --git a/src/ng/browser.js b/src/ng/browser.js index 3925348317ce..cfc1b80d08d7 100644 --- a/src/ng/browser.js +++ b/src/ng/browser.js @@ -18,7 +18,6 @@ /** * @param {object} window The global window object. * @param {object} document jQuery wrapped document. - * @param {function()} XHR XMLHttpRequest constructor. * @param {object} $log console.log or an object with the same interface. * @param {object} $sniffer $sniffer service */ @@ -205,7 +204,7 @@ function Browser(window, document, $log, $sniffer) { * @param {function(string)} listener Listener function to be called when url changes. * @return {function(string)} Returns the registered listener fn - handy if the fn is anonymous. */ - self.onUrlChange = function(callback) { + self.onUrlChange = function(listener) { if (!urlChangeInit) { // We listen on both (hashchange/popstate) when available, as some browsers (e.g. Opera) // don't fire popstate when user change the address bar and don't fire hashchange when url @@ -221,8 +220,8 @@ function Browser(window, document, $log, $sniffer) { urlChangeInit = true; } - urlChangeListeners.push(callback); - return callback; + urlChangeListeners.push(listener); + return listener; }; ////////////////////////////////////////////////////////////// diff --git a/src/ng/compile.js b/src/ng/compile.js index 9ed7f1079a31..b2800359fcf2 100644 --- a/src/ng/compile.js +++ b/src/ng/compile.js @@ -363,7 +363,7 @@ function $CompileProvider($provide) { * @param {DOMElement=} $rootElement If the nodeList is the root of the compilation tree then the * rootElement must be set the jqLite collection of the compile root. This is * needed so that the jqLite collection items can be replaced with widgets. - * @param {number=} max directive priority + * @param {number=} maxPriority directive priority * @returns {?function} A composite linking function of all of the matched directives or null. */ function compileNodes(nodeList, transcludeFn, $rootElement, maxPriority) { diff --git a/src/ng/rootScope.js b/src/ng/rootScope.js index c99416f0040d..b30ea65755ed 100644 --- a/src/ng/rootScope.js +++ b/src/ng/rootScope.js @@ -120,13 +120,7 @@ function $RootScopeProvider(){ * * * - * @param {Object.=} providers Map of service factory which need to be provided - * for the current scope. Defaults to {@link ng}. - * @param {Object.=} instanceCache Provides pre-instantiated services which should - * append/override services provided by `providers`. This is handy when unit-testing and having - * the need to override a default service. * @returns {Object} Newly created scope. - * */ function Scope() { this.$id = nextUid(); @@ -266,14 +260,14 @@ function $RootScopeProvider(){ * * * - * @param {(function()|string)} watchExpression Expression that is evaluated on each + * @param {(function()|string)} watchExp Expression that is evaluated on each * {@link ng.$rootScope.Scope#$digest $digest} cycle. A change in the return value triggers a * call to the `listener`. * * - `string`: Evaluated as {@link guide/expression expression} * - `function(scope)`: called with current `scope` as a parameter. * @param {(function()|string)=} listener Callback called whenever the return value of - * the `watchExpression` changes. + * the `watchExp` changes. * * - `string`: Evaluated as {@link guide/expression expression} * - `function(newValue, oldValue, scope)`: called with current and previous values as parameters. @@ -506,7 +500,7 @@ function $RootScopeProvider(){ expect(scope.$eval(function(scope){ return scope.a + scope.b; })).toEqual(3); * * - * @param {(string|function())=} expression An angular expression to be executed. + * @param {(string|function())=} expr An angular expression to be executed. * * - `string`: execute using the rules as defined in {@link guide/expression expression}. * - `function(scope)`: execute the function with the current `scope` parameter. @@ -535,7 +529,7 @@ function $RootScopeProvider(){ * Any exceptions from the execution of the expression are forwarded to the * {@link ng.$exceptionHandler $exceptionHandler} service. * - * @param {(string|function())=} expression An angular expression to be executed. + * @param {(string|function())=} expr An angular expression to be executed. * * - `string`: execute using the rules as defined in {@link guide/expression expression}. * - `function(scope)`: execute the function with the current `scope` parameter. @@ -584,7 +578,7 @@ function $RootScopeProvider(){ * was executed using the {@link ng.$rootScope.Scope#$digest $digest()} method. * * - * @param {(string|function())=} exp An angular expression to be executed. + * @param {(string|function())=} expr An angular expression to be executed. * * - `string`: execute using the rules as defined in {@link guide/expression expression}. * - `function(scope)`: execute the function with current `scope` parameter. From 6aa6458597c746ccc2a6ddd8a08fc22dfd41629c Mon Sep 17 00:00:00 2001 From: Ben McCann Date: Sat, 15 Dec 2012 18:51:04 -0800 Subject: [PATCH 04/36] Add back accidentally removed @ngdoc function --- src/Angular.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Angular.js b/src/Angular.js index 1383134befe6..00212237c8ae 100644 --- a/src/Angular.js +++ b/src/Angular.js @@ -646,6 +646,7 @@ function sliceArgs(args, startIndex) { /** + * @ngdoc function * * @name angular.bind * @function From 1b8a961cb14fd602bd6886f7dedcd17d67fb0cad Mon Sep 17 00:00:00 2001 From: Ben McCann Date: Sat, 15 Dec 2012 19:07:56 -0800 Subject: [PATCH 05/36] Use correct capitalization for {Object} type in jsdocs --- example/personalLog/personalLog.js | 2 +- src/Angular.js | 6 +++--- src/ng/browser.js | 8 ++++---- src/ng/cacheFactory.js | 4 ++-- src/ng/compile.js | 6 +++--- src/ng/http.js | 2 +- src/ng/q.js | 2 +- src/ngSanitize/sanitize.js | 4 ++-- 8 files changed, 17 insertions(+), 17 deletions(-) diff --git a/example/personalLog/personalLog.js b/example/personalLog/personalLog.js index c22b8702e4a6..5015cd6466a7 100644 --- a/example/personalLog/personalLog.js +++ b/example/personalLog/personalLog.js @@ -46,7 +46,7 @@ app.controller('LogCtrl', ['$cookieStore', '$scope', function LogCtrl($cookieSto /** * Persistently removes a log from logs. - * @param {object} log The log to remove. + * @param {Object} log The log to remove. */ $scope.rmLog = function(log) { for ( var i = 0; i < logs.length; i++) { diff --git a/src/Angular.js b/src/Angular.js index 00212237c8ae..ebab7b2186d2 100644 --- a/src/Angular.js +++ b/src/Angular.js @@ -185,8 +185,8 @@ function nextUid() { * * @param {Object} dst Destination object. */ -function extend(dst) { - forEach(arguments, function(obj){ +function extend(dst, var_args) { + forEach(var_args, function(obj){ if (obj !== dst) { forEach(obj, function(value, key){ dst[key] = value; @@ -413,7 +413,7 @@ function isElement(node) { /** * @param str 'key1,key2,...' - * @returns {object} in the form of {key1:true, key2:true, ...} + * @returns {Object} in the form of {key1:true, key2:true, ...} */ function makeMap(str){ var obj = {}, items = str.split(","), i; diff --git a/src/ng/browser.js b/src/ng/browser.js index cfc1b80d08d7..3bee599a85eb 100644 --- a/src/ng/browser.js +++ b/src/ng/browser.js @@ -16,10 +16,10 @@ * the real browser apis. */ /** - * @param {object} window The global window object. - * @param {object} document jQuery wrapped document. - * @param {object} $log console.log or an object with the same interface. - * @param {object} $sniffer $sniffer service + * @param {Object} window The global window object. + * @param {Object} document jQuery wrapped document. + * @param {Object} $log console.log or an object with the same interface. + * @param {Object} $sniffer $sniffer service */ function Browser(window, document, $log, $sniffer) { var self = this, diff --git a/src/ng/cacheFactory.js b/src/ng/cacheFactory.js index ce690ebfe2a4..91416b5fa1a6 100644 --- a/src/ng/cacheFactory.js +++ b/src/ng/cacheFactory.js @@ -11,9 +11,9 @@ * * - `{number=}` `capacity` — turns the cache into LRU cache. * - * @returns {object} Newly created cache object with the following set of methods: + * @returns {Object} Newly created cache object with the following set of methods: * - * - `{object}` `info()` — Returns id, size, and options of cache. + * - `{Object}` `info()` — Returns id, size, and options of cache. * - `{{*}}` `put({string} key, {*} value)` — Puts a new key-value pair into the cache and returns it. * - `{{*}}` `get({string} key)` — Returns cached value for `key` or undefined for cache miss. * - `{void}` `remove({string} key)` — Removes a key-value pair from the cache. diff --git a/src/ng/compile.js b/src/ng/compile.js index b2800359fcf2..dba042e2a8b8 100644 --- a/src/ng/compile.js +++ b/src/ng/compile.js @@ -858,8 +858,8 @@ function $CompileProvider($provide) { * on the template need to be merged with the existing attributes in the DOM. * The desired effect is to have both of the attributes present. * - * @param {object} dst destination attributes (original DOM) - * @param {object} src source attributes (from the directive template) + * @param {Object} dst destination attributes (original DOM) + * @param {Object} src source attributes (from the directive template) */ function mergeTemplateAttributes(dst, src) { var srcAttr = src.$attr, @@ -1101,7 +1101,7 @@ function directiveNormalize(name) { * @ngdoc property * @name ng.$compile.directive.Attributes#$attr * @propertyOf ng.$compile.directive.Attributes - * @returns {object} A map of DOM element attribute names to the normalized name. This is + * @returns {Object} A map of DOM element attribute names to the normalized name. This is * needed to do reverse lookup from normalized name back to actual name. */ diff --git a/src/ng/http.js b/src/ng/http.js index a3c7d4a0def2..c5eef19e4d60 100644 --- a/src/ng/http.js +++ b/src/ng/http.js @@ -393,7 +393,7 @@ function $HttpProvider() { * cookie with {@link http://en.wikipedia.org/wiki/Rainbow_table salt for added security}. * * - * @param {object} config Object describing the request to be made and how it should be + * @param {Object} config Object describing the request to be made and how it should be * processed. The object has following properties: * * - **method** – `{string}` – HTTP method (e.g. 'GET', 'POST', etc) diff --git a/src/ng/q.js b/src/ng/q.js index 8b4747552081..5b80a97a55fa 100644 --- a/src/ng/q.js +++ b/src/ng/q.js @@ -164,7 +164,7 @@ function $QProvider() { * @param {function(function)} nextTick Function for executing functions in the next turn. * @param {function(...*)} exceptionHandler Function into which unexpected exceptions are passed for * debugging purposes. - * @returns {object} Promise manager. + * @returns {Object} Promise manager. */ function qFactory(nextTick, exceptionHandler) { diff --git a/src/ngSanitize/sanitize.js b/src/ngSanitize/sanitize.js index 04eafa0d77dc..f4dc1d7e4cb2 100644 --- a/src/ngSanitize/sanitize.js +++ b/src/ngSanitize/sanitize.js @@ -183,7 +183,7 @@ function makeMap(str) { * }); * * @param {string} html string - * @param {object} handler + * @param {Object} handler */ function htmlParser( html, handler ) { var index, chars, match, stack = [], last = html; @@ -339,7 +339,7 @@ function encodeEntities(value) { /** * create an HTML/XML writer which writes to buffer * @param {Array} buf use buf.jain('') to get out sanitized html string - * @returns {object} in the form of { + * @returns {Object} in the form of { * start: function(tag, attrs, unary) {}, * end: function(tag) {}, * chars: function(text) {}, From 9dea94de1ac46e3f8608690d8001615380d2293f Mon Sep 17 00:00:00 2001 From: Ben McCann Date: Sat, 15 Dec 2012 19:09:30 -0800 Subject: [PATCH 06/36] Remove accidentally added blank line --- src/Angular.js | 1 - 1 file changed, 1 deletion(-) diff --git a/src/Angular.js b/src/Angular.js index ebab7b2186d2..0ff6d3101426 100644 --- a/src/Angular.js +++ b/src/Angular.js @@ -647,7 +647,6 @@ function sliceArgs(args, startIndex) { /** * @ngdoc function - * * @name angular.bind * @function * From 943c667f6025891343daf5e6b64462b4362d9367 Mon Sep 17 00:00:00 2001 From: Ben McCann Date: Sat, 15 Dec 2012 19:22:33 -0800 Subject: [PATCH 07/36] Try fixing var_args in a way that Closure Compiler likes --- src/Angular.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/Angular.js b/src/Angular.js index 0ff6d3101426..5d4405b4c1f2 100644 --- a/src/Angular.js +++ b/src/Angular.js @@ -186,7 +186,7 @@ function nextUid() { * @param {Object} dst Destination object. */ function extend(dst, var_args) { - forEach(var_args, function(obj){ + forEach(arguments, function(obj){ if (obj !== dst) { forEach(obj, function(value, key){ dst[key] = value; @@ -661,17 +661,17 @@ function sliceArgs(args, startIndex) { * @returns {function()} Function that wraps the `fn` with all the specified bindings. */ function bind(self, fn, var_args) { - var curryArgs = var_args.length > 2 ? sliceArgs(var_args, 2) : []; + var curryArgs = arguments.length > 2 ? sliceArgs(arguments, 2) : []; if (isFunction(fn) && !(fn instanceof RegExp)) { return curryArgs.length ? function() { - return var_args.length - ? fn.apply(self, curryArgs.concat(slice.call(var_args, 0))) + return arguments.length + ? fn.apply(self, curryArgs.concat(slice.call(arguments, 0))) : fn.apply(self, curryArgs); } : function() { - return var_args.length - ? fn.apply(self, var_args) + return arguments.length + ? fn.apply(self, arguments) : fn.call(self); }; } else { From f86dcc8bb9fb885539dfa50daf47fea6240c7c84 Mon Sep 17 00:00:00 2001 From: Ben McCann Date: Sat, 15 Dec 2012 20:25:25 -0800 Subject: [PATCH 08/36] Reference JSON via wondow object --- src/Angular.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Angular.js b/src/Angular.js index 5d4405b4c1f2..16c4fab5052b 100644 --- a/src/Angular.js +++ b/src/Angular.js @@ -711,7 +711,7 @@ function toJsonReplacer(key, value) { * @returns {string} Jsonified string representing `obj`. */ function toJson(obj, pretty) { - return JSON.stringify(obj, toJsonReplacer, pretty ? ' ' : null); + return window.JSON.stringify(obj, toJsonReplacer, pretty ? ' ' : null); } @@ -728,7 +728,7 @@ function toJson(obj, pretty) { */ function fromJson(json) { return isString(json) - ? JSON.parse(json) + ? window.JSON.parse(json) : json; } From 565ff1df67f2b0d4d53ccda5375ad262a41ff2ae Mon Sep 17 00:00:00 2001 From: Ben McCann Date: Sat, 15 Dec 2012 20:33:28 -0800 Subject: [PATCH 09/36] Fix illegal return type --- src/ng/browser.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ng/browser.js b/src/ng/browser.js index 3bee599a85eb..f732a69df4a6 100644 --- a/src/ng/browser.js +++ b/src/ng/browser.js @@ -232,7 +232,7 @@ function Browser(window, document, $log, $sniffer) { * Returns current * (always relative - without domain) * - * @returns {string=} + * @returns {string|null} */ self.baseHref = function() { var href = baseElement.attr('href'); From ba9ec6ae3ece16e02fae69f818cebf9ccfd12e35 Mon Sep 17 00:00:00 2001 From: Ben McCann Date: Sat, 15 Dec 2012 20:56:04 -0800 Subject: [PATCH 10/36] Fix type warning --- src/Angular.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Angular.js b/src/Angular.js index 16c4fab5052b..fc6438b04682 100644 --- a/src/Angular.js +++ b/src/Angular.js @@ -529,16 +529,16 @@ function isLeafNode (node) { function copy(source, destination){ if (isWindow(source) || isScope(source)) throw Error("Can't copy Window or Scope"); if (!destination) { - destination = source; if (source) { if (isArray(source)) { - destination = copy(source, []); + return copy(source, []); } else if (isDate(source)) { - destination = new Date(source.getTime()); + return new Date(source.getTime()); } else if (isObject(source)) { - destination = copy(source, {}); + return copy(source, {}); } } + return source; } else { if (source === destination) throw Error("Can't copy equivalent objects or arrays"); if (isArray(source)) { From 9aa7324d2647949a077821509120370c88809935 Mon Sep 17 00:00:00 2001 From: Ben McCann Date: Sat, 15 Dec 2012 21:00:34 -0800 Subject: [PATCH 11/36] Coerce to boolean. Return type is not currently what is expected --- src/Angular.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Angular.js b/src/Angular.js index fc6438b04682..9ed462568449 100644 --- a/src/Angular.js +++ b/src/Angular.js @@ -371,7 +371,7 @@ function isFunction(value){return typeof value == 'function';} * @returns {boolean} True if `obj` is a window obj. */ function isWindow(obj) { - return obj && obj.document && obj.location && obj.alert && obj.setInterval; + return Boolean(obj && obj.document && obj.location && obj.alert && obj.setInterval); } @@ -406,9 +406,9 @@ function trim(value) { * @returns {boolean} True if `value` is a DOM element (or wrapped jQuery element). */ function isElement(node) { - return node && + return Boolean(node && (node.nodeName // we are a direct element - || (node.bind && node.find)); // we have a bind and find method part of jQuery API + || (node.bind && node.find))); // we have a bind and find method part of jQuery API } /** From 6c6e4b454eb948f5ad329231f821f1d9033a9fb8 Mon Sep 17 00:00:00 2001 From: Ben McCann Date: Sat, 15 Dec 2012 21:05:12 -0800 Subject: [PATCH 12/36] Fix shared type warnings --- src/Angular.js | 3 ++- src/jqLite.js | 8 ++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/Angular.js b/src/Angular.js index 9ed462568449..279ca616c956 100644 --- a/src/Angular.js +++ b/src/Angular.js @@ -766,7 +766,8 @@ function startingTag(element) { * @returns Object.<(string|boolean)> */ function parseKeyValue(/**string*/keyValue) { - var obj = {}, key_value, key; + var obj = {}; + var key_value, key; forEach((keyValue || "").split('&'), function(keyValue){ if (keyValue) { key_value = keyValue.split('='); diff --git a/src/jqLite.js b/src/jqLite.js index 8305f0c30f2c..6057afbdaec0 100644 --- a/src/jqLite.js +++ b/src/jqLite.js @@ -75,10 +75,10 @@ * @returns {Object} jQuery object. */ -var jqCache = JQLite.cache = {}, - jqName = JQLite.expando = 'ng-' + new Date().getTime(), - jqId = 1, - addEventListenerFn = (window.document.addEventListener +var jqCache = JQLite.cache = {}; +var jqName = JQLite.expando = 'ng-' + new Date().getTime(); +var jqId = 1; +var addEventListenerFn = (window.document.addEventListener ? function(element, type, fn) {element.addEventListener(type, fn, false);} : function(element, type, fn) {element.attachEvent('on' + type, fn);}), removeEventListenerFn = (window.document.removeEventListener From 601069889231b7a06ddf7a2cfa2fad20a7fa4111 Mon Sep 17 00:00:00 2001 From: Ben McCann Date: Sat, 15 Dec 2012 21:10:36 -0800 Subject: [PATCH 13/36] Optional arguments must be at the end --- src/loader.js | 2 +- src/ng/compile.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/loader.js b/src/loader.js index 9e39d161cb99..f77e7f67fbae 100644 --- a/src/loader.js +++ b/src/loader.js @@ -58,7 +58,7 @@ function setupModuleLoader(window) { * {@link angular.bootstrap} to simplify this process for you. * * @param {!string} name The name of the module to create or retrieve. - * @param {Array.=} requires If specified then new module is being created. If unspecified then the + * @param {Array.} requires If specified then new module is being created. If unspecified then the * the module is being retrieved for further configuration. * @param {Function} configFn Optional configuration function for the module. Same as * {@link angular.Module#config Module#config()}. diff --git a/src/ng/compile.js b/src/ng/compile.js index dba042e2a8b8..53fc4cb591ba 100644 --- a/src/ng/compile.js +++ b/src/ng/compile.js @@ -1039,7 +1039,7 @@ function $CompileProvider($provide) { * This is a special jqLite.replaceWith, which can replace items which * have no parents, provided that the containing jqLite collection is provided. * - * @param {JqLite=} $rootElement The root of the compile tree. Used so that we can replace nodes + * @param {JqLite} $rootElement The root of the compile tree. Used so that we can replace nodes * in the root of the tree. * @param {JqLite} $element The jqLite element which we are going to replace. We keep the shell, * but replace its DOM node reference. From 5e1f0c7d7291d24c908572e7cc32aaaaf6d52e16 Mon Sep 17 00:00:00 2001 From: Ben McCann Date: Sat, 15 Dec 2012 21:39:06 -0800 Subject: [PATCH 14/36] Add missing @constructor annotations --- src/apis.js | 2 ++ src/auto/injector.js | 12 +++++++----- src/jqLite.js | 5 ++++- src/ng/browser.js | 1 + src/ng/compile.js | 3 +++ src/ng/location.js | 3 +++ src/ng/rootScope.js | 4 ++++ 7 files changed, 24 insertions(+), 6 deletions(-) diff --git a/src/apis.js b/src/apis.js index 0e94e2a55ce2..cd421708ea91 100644 --- a/src/apis.js +++ b/src/apis.js @@ -33,6 +33,7 @@ function hashKey(obj) { /** * HashMap which can use objects as keys + * @constructor */ function HashMap(array){ forEach(array, this.put, this); @@ -69,6 +70,7 @@ HashMap.prototype = { /** * A map where multiple values can be added to the same key such that they form a queue. * @returns {HashQueueMap} + * @constructor */ function HashQueueMap() {} HashQueueMap.prototype = { diff --git a/src/auto/injector.js b/src/auto/injector.js index bdc82da51a83..d7256d56c2ac 100644 --- a/src/auto/injector.js +++ b/src/auto/injector.js @@ -159,7 +159,7 @@ function annotate(fn) { * Create a new instance of JS type. The method takes a constructor function invokes the new operator and supplies * all of the arguments to the constructor function as specified by the constructor annotation. * - * @param {function} Type Annotated constructor function. + * @param {function()} Type Annotated constructor function. * @param {Object=} locals Optional object. If preset then any argument names are read from this object first, before * the `$injector` is consulted. * @returns {Object} new instance of `Type`. @@ -583,12 +583,14 @@ function createInjector(modulesToLoad) { } function instantiate(Type, locals) { - var Constructor = function() {}, - instance, returnedValue; + /** + * @constructor + */ + var Constructor = function() {}; Constructor.prototype = (isArray(Type) ? Type[Type.length - 1] : Type).prototype; - instance = new Constructor(); - returnedValue = invoke(Type, instance, locals); + var instance = new Constructor(); + var returnedValue = invoke(Type, instance, locals); return isObject(returnedValue) ? returnedValue : instance; } diff --git a/src/jqLite.js b/src/jqLite.js index 6057afbdaec0..689cd82b249d 100644 --- a/src/jqLite.js +++ b/src/jqLite.js @@ -146,6 +146,9 @@ function JQLitePatchJQueryRemove(name, dispatchThis) { } ///////////////////////////////////////////// +/** + * @constructor + */ function JQLite(element) { if (element instanceof JQLite) { return element; @@ -329,7 +332,7 @@ var JQLitePrototype = JQLite.prototype = { this.bind('DOMContentLoaded', trigger); // works for modern browsers and IE9 // we can not use jqLite since we are not done loading and jQuery could be loaded later. - JQLite(window).bind('load', trigger); // fallback to window.onload for others + new JQLite(window).bind('load', trigger); // fallback to window.onload for others }, toString: function() { var value = []; diff --git a/src/ng/browser.js b/src/ng/browser.js index f732a69df4a6..6d0f315d3333 100644 --- a/src/ng/browser.js +++ b/src/ng/browser.js @@ -20,6 +20,7 @@ * @param {Object} document jQuery wrapped document. * @param {Object} $log console.log or an object with the same interface. * @param {Object} $sniffer $sniffer service + * @constructor */ function Browser(window, document, $log, $sniffer) { var self = this, diff --git a/src/ng/compile.js b/src/ng/compile.js index 53fc4cb591ba..7f8884e53e40 100644 --- a/src/ng/compile.js +++ b/src/ng/compile.js @@ -215,6 +215,9 @@ function $CompileProvider($provide) { function($injector, $interpolate, $exceptionHandler, $http, $templateCache, $parse, $controller, $rootScope) { + /** + * @constructor + */ var Attributes = function(element, attr) { this.$$element = element; this.$attr = attr || {}; diff --git a/src/ng/location.js b/src/ng/location.js index 19ebaf6d401e..7409e390a065 100644 --- a/src/ng/location.js +++ b/src/ng/location.js @@ -399,6 +399,9 @@ LocationUrl.prototype = { LocationHashbangUrl.prototype = inherit(LocationUrl.prototype); +/** + * @constructor + */ function LocationHashbangInHtml5Url(url, hashPrefix, appBaseUrl, baseExtra) { LocationHashbangUrl.apply(this, arguments); diff --git a/src/ng/rootScope.js b/src/ng/rootScope.js index b30ea65755ed..4fe7cb89ca11 100644 --- a/src/ng/rootScope.js +++ b/src/ng/rootScope.js @@ -121,6 +121,7 @@ function $RootScopeProvider(){ * * * @returns {Object} Newly created scope. + * @constructor */ function Scope() { this.$id = nextUid(); @@ -180,6 +181,9 @@ function $RootScopeProvider(){ child = new Scope(); child.$root = this.$root; } else { + /** + * @constructor + */ Child = function() {}; // should be anonymous; This is so that when the minifier munges // the name it does not become random set of chars. These will then show up as class // name in the debugger. From e28d086a198fcad4ce7b95aa52145dc6d9fb26f6 Mon Sep 17 00:00:00 2001 From: Ben McCann Date: Sat, 15 Dec 2012 22:11:07 -0800 Subject: [PATCH 15/36] Typecast to avoid compiler warning --- src/Angular.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Angular.js b/src/Angular.js index 279ca616c956..fc7f37404634 100644 --- a/src/Angular.js +++ b/src/Angular.js @@ -329,7 +329,7 @@ function isNumber(value){return typeof value == 'number';} * @returns {boolean} True if `value` is a `Date`. */ function isDate(value){ - return toString.apply(value) == '[object Date]'; + return toString.apply(/** @type {Object} */ (value)) == '[object Date]'; } @@ -345,7 +345,7 @@ function isDate(value){ * @returns {boolean} True if `value` is an `Array`. */ function isArray(value) { - return toString.apply(value) == '[object Array]'; + return toString.apply(/** @type {Object} */ (value)) == '[object Array]'; } From 4fdf37a4eeed3a8ba7ddbb1430804bf0254b5a88 Mon Sep 17 00:00:00 2001 From: Ben McCann Date: Sat, 15 Dec 2012 22:31:29 -0800 Subject: [PATCH 16/36] Fix capitalization of string type --- src/loader.js | 2 +- src/ng/filter.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/loader.js b/src/loader.js index f77e7f67fbae..2c300e4efb5b 100644 --- a/src/loader.js +++ b/src/loader.js @@ -233,7 +233,7 @@ function setupModuleLoader(window) { /** * @param {string} provider * @param {string} method - * @param {String=} insertMethod + * @param {string=} insertMethod * @returns {angular.Module} */ function invokeLater(provider, method, insertMethod) { diff --git a/src/ng/filter.js b/src/ng/filter.js index e3ccb72ee2b6..c45d02aab2c3 100644 --- a/src/ng/filter.js +++ b/src/ng/filter.js @@ -55,7 +55,7 @@ * @description * Register filter factory function. * - * @param {String} name Name of the filter. + * @param {string} name Name of the filter. * @param {function} fn The filter factory function which is injectable. */ @@ -71,7 +71,7 @@ * * {{ expression | [ filter_name ] }} * - * @param {String} name Name of the filter function to retrieve + * @param {string} name Name of the filter function to retrieve * @return {Function} the filter function */ $FilterProvider.$inject = ['$provide']; From d12a03d3b4c799253c540a75ebcbea4940b9426c Mon Sep 17 00:00:00 2001 From: Ben McCann Date: Sat, 15 Dec 2012 22:34:51 -0800 Subject: [PATCH 17/36] Fix references to Element type --- src/jqLite.js | 2 +- src/ng/compile.js | 6 +++--- src/ngScenario/Scenario.js | 2 +- test/testabilityPatch.js | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/jqLite.js b/src/jqLite.js index 689cd82b249d..5f0dbf1a160a 100644 --- a/src/jqLite.js +++ b/src/jqLite.js @@ -71,7 +71,7 @@ * - `inheritedData()` - same as `data()`, but walks up the DOM until a value is found or the top * parent element is reached. * - * @param {string|DOMElement} element HTML string or DOMElement to be wrapped into jQuery. + * @param {string|Element} element HTML string or Element to be wrapped into jQuery. * @returns {Object} jQuery object. */ diff --git a/src/ng/compile.js b/src/ng/compile.js index 7f8884e53e40..c374468d69c9 100644 --- a/src/ng/compile.js +++ b/src/ng/compile.js @@ -92,7 +92,7 @@ var NON_ASSIGNABLE_MODEL_EXPRESSION = 'Non-assignable model expression: '; * * - * @param {string|DOMElement} element Element or HTML string to compile into a template function. + * @param {string|Element} element Element or HTML string to compile into a template function. * @param {function(angular.Scope[, cloneAttachFn]} transclude function available to directives. * @param {number} maxPriority only apply directives lower then given priority (Only effects the * root element(s), not their children) @@ -363,7 +363,7 @@ function $CompileProvider($provide) { * @param {NodeList} nodeList an array of nodes to compile * @param {function(angular.Scope[, cloneAttachFn]} transcludeFn A linking function, where the * scope argument is auto-generated to the new child of the transcluded parent scope. - * @param {DOMElement=} $rootElement If the nodeList is the root of the compilation tree then the + * @param {Element=} $rootElement If the nodeList is the root of the compilation tree then the * rootElement must be set the jqLite collection of the compile root. This is * needed so that the jqLite collection items can be replaced with widgets. * @param {number=} maxPriority directive priority @@ -522,7 +522,7 @@ function $CompileProvider($provide) { * @param {Object} templateAttrs The shared attribute function * @param {function(angular.Scope[, cloneAttachFn]} transcludeFn A linking function, where the * scope argument is auto-generated to the new child of the transcluded parent scope. - * @param {DOMElement} $rootElement If we are working on the root of the compile tree then this + * @param {Element} $rootElement If we are working on the root of the compile tree then this * argument has the root jqLite array so that we can replace widgets on it. * @returns linkFn */ diff --git a/src/ngScenario/Scenario.js b/src/ngScenario/Scenario.js index 4833e62954b3..2fdfab3fcd40 100644 --- a/src/ngScenario/Scenario.js +++ b/src/ngScenario/Scenario.js @@ -227,7 +227,7 @@ function callerFile(offset) { * Triggers a browser event. Attempts to choose the right event if one is * not specified. * - * @param {Object} element Either a wrapped jQuery/jqLite node or a DOMElement + * @param {Object} element Either a wrapped jQuery/jqLite node or a Element * @param {string} type Optional event type. * @param {Array.=} keys Optional list of pressed keys * (valid values: 'alt', 'meta', 'shift', 'ctrl') diff --git a/test/testabilityPatch.js b/test/testabilityPatch.js index ac22c72c05cd..913313b96129 100644 --- a/test/testabilityPatch.js +++ b/test/testabilityPatch.js @@ -85,7 +85,7 @@ function dealoc(obj) { } /** - * @param {DOMElement} element + * @param {Element} element * @param {boolean=} showNgClass */ function sortedHtml(element, showNgClass) { From b9c3797226b8ec87fd121e1b2785c8238c0925a3 Mon Sep 17 00:00:00 2001 From: Ben McCann Date: Sat, 15 Dec 2012 22:43:34 -0800 Subject: [PATCH 18/36] Fix missing closing parentheses --- src/ng/compile.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/ng/compile.js b/src/ng/compile.js index c374468d69c9..d9f6aaa83e7f 100644 --- a/src/ng/compile.js +++ b/src/ng/compile.js @@ -93,10 +93,10 @@ var NON_ASSIGNABLE_MODEL_EXPRESSION = 'Non-assignable model expression: '; * * * @param {string|Element} element Element or HTML string to compile into a template function. - * @param {function(angular.Scope[, cloneAttachFn]} transclude function available to directives. + * @param {function(angular.Scope, cloneAttachFn=)} transclude function available to directives. * @param {number} maxPriority only apply directives lower then given priority (Only effects the * root element(s), not their children) - * @returns {function(scope[, cloneAttachFn])} a link function which is used to bind template + * @returns {function(scope, cloneAttachFn=)} a link function which is used to bind template * (a DOM element/tree) to a scope. Where: * * * `scope` - A {@link ng.$rootScope.Scope Scope} to bind to. @@ -361,7 +361,7 @@ function $CompileProvider($provide) { * function, which is the a linking function for the node. * * @param {NodeList} nodeList an array of nodes to compile - * @param {function(angular.Scope[, cloneAttachFn]} transcludeFn A linking function, where the + * @param {function(angular.Scope, cloneAttachFn=)} transcludeFn A linking function, where the * scope argument is auto-generated to the new child of the transcluded parent scope. * @param {Element=} $rootElement If the nodeList is the root of the compilation tree then the * rootElement must be set the jqLite collection of the compile root. This is @@ -520,7 +520,7 @@ function $CompileProvider($provide) { * this needs to be pre-sorted by priority order. * @param {Node} compileNode The raw DOM node to apply the compile functions to * @param {Object} templateAttrs The shared attribute function - * @param {function(angular.Scope[, cloneAttachFn]} transcludeFn A linking function, where the + * @param {function(angular.Scope, cloneAttachFn=)} transcludeFn A linking function, where the * scope argument is auto-generated to the new child of the transcluded parent scope. * @param {Element} $rootElement If we are working on the root of the compile tree then this * argument has the root jqLite array so that we can replace widgets on it. From 3fc2442043c4c849d6411104b5a173928e159c7d Mon Sep 17 00:00:00 2001 From: Ben McCann Date: Sat, 15 Dec 2012 22:59:28 -0800 Subject: [PATCH 19/36] Add missing jsdocs --- src/ng/filter/filters.js | 29 ++++++++++++++++++++++++----- 1 file changed, 24 insertions(+), 5 deletions(-) diff --git a/src/ng/filter/filters.js b/src/ng/filter/filters.js index de8a4ebc78d7..48529025e82e 100644 --- a/src/ng/filter/filters.js +++ b/src/ng/filter/filters.js @@ -177,21 +177,33 @@ function formatNumber(number, pattern, groupSep, decimalSep, fractionSize) { return parts.join(''); } +/** + * @param {number} num + * @param {number} digits + * @param {boolean=} trim + * @returns {string} + */ function padNumber(num, digits, trim) { var neg = ''; if (num < 0) { neg = '-'; num = -num; } - num = '' + num; - while(num.length < digits) num = '0' + num; + var str = '' + num; + while(str.length < digits) str = '0' + str; if (trim) - num = num.substr(num.length - digits); - return neg + num; + str = str.substr(num.length - digits); + return neg + str; } -function dateGetter(name, size, offset, trim) { +/** + * @param {string} name + * @param {number} size + * @param {number=} offset + * @param {boolean=} trim + */ + function dateGetter(name, size, offset, trim) { return function(date) { var value = date['get' + name](); if (offset > 0 || value > -offset) @@ -201,6 +213,10 @@ function dateGetter(name, size, offset, trim) { }; } +/** + * @param {string} name + * @param {boolean=} shortForm + */ function dateStrGetter(name, shortForm) { return function(date, formats) { var value = date['get' + name](); @@ -210,6 +226,9 @@ function dateStrGetter(name, shortForm) { }; } +/** + * @param {Date} date + */ function timeZoneGetter(date) { var offset = date.getTimezoneOffset(); return padNumber(offset / 60, 2) + padNumber(Math.abs(offset % 60), 2); From 63b3b9866b54c8845745bcff0f99a03dcd25c0f1 Mon Sep 17 00:00:00 2001 From: Ben McCann Date: Sat, 15 Dec 2012 23:08:14 -0800 Subject: [PATCH 20/36] Fix headersGetter types --- src/ng/http.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/ng/http.js b/src/ng/http.js index c5eef19e4d60..b63758a389bc 100644 --- a/src/ng/http.js +++ b/src/ng/http.js @@ -72,7 +72,7 @@ function isSameDomain(requestUrl, locationUrl) { * Headers are lazy parsed when first requested. * @see parseHeaders * - * @param {(string|Object)} headers Headers to provide access to. + * @param {string} headers Headers to provide access to. * @returns {function(string=)} Returns a getter function which if called with: * * - if called with single an argument returns a single header value or null @@ -81,6 +81,9 @@ function isSameDomain(requestUrl, locationUrl) { function headersGetter(headers) { var headersObj = isObject(headers) ? headers : undefined; + /** + * @param {string=} name The header name. + */ return function(name) { if (!headersObj) headersObj = parseHeaders(headers); From 8bc454ce550f76c203d66cbfbc4f8a9fe4cc4aed Mon Sep 17 00:00:00 2001 From: Ben McCann Date: Sat, 15 Dec 2012 23:12:25 -0800 Subject: [PATCH 21/36] Revert optional function syntax change --- src/ng/compile.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/ng/compile.js b/src/ng/compile.js index d9f6aaa83e7f..792a2ea4fd3f 100644 --- a/src/ng/compile.js +++ b/src/ng/compile.js @@ -93,10 +93,10 @@ var NON_ASSIGNABLE_MODEL_EXPRESSION = 'Non-assignable model expression: '; * * * @param {string|Element} element Element or HTML string to compile into a template function. - * @param {function(angular.Scope, cloneAttachFn=)} transclude function available to directives. + * @param {function(angular.Scope[, cloneAttachFn])} transclude function available to directives. * @param {number} maxPriority only apply directives lower then given priority (Only effects the * root element(s), not their children) - * @returns {function(scope, cloneAttachFn=)} a link function which is used to bind template + * @returns {function(scope[, cloneAttachFn])} a link function which is used to bind template * (a DOM element/tree) to a scope. Where: * * * `scope` - A {@link ng.$rootScope.Scope Scope} to bind to. @@ -361,7 +361,7 @@ function $CompileProvider($provide) { * function, which is the a linking function for the node. * * @param {NodeList} nodeList an array of nodes to compile - * @param {function(angular.Scope, cloneAttachFn=)} transcludeFn A linking function, where the + * @param {function(angular.Scope[, cloneAttachFn])} transcludeFn A linking function, where the * scope argument is auto-generated to the new child of the transcluded parent scope. * @param {Element=} $rootElement If the nodeList is the root of the compilation tree then the * rootElement must be set the jqLite collection of the compile root. This is @@ -520,7 +520,7 @@ function $CompileProvider($provide) { * this needs to be pre-sorted by priority order. * @param {Node} compileNode The raw DOM node to apply the compile functions to * @param {Object} templateAttrs The shared attribute function - * @param {function(angular.Scope, cloneAttachFn=)} transcludeFn A linking function, where the + * @param {function(angular.Scope[, cloneAttachFn])} transcludeFn A linking function, where the * scope argument is auto-generated to the new child of the transcluded parent scope. * @param {Element} $rootElement If we are working on the root of the compile tree then this * argument has the root jqLite array so that we can replace widgets on it. From f3c1f31dadc4f001094484f5e83a68b2a6fafb92 Mon Sep 17 00:00:00 2001 From: Ben McCann Date: Sat, 15 Dec 2012 23:19:07 -0800 Subject: [PATCH 22/36] Revert add missing parens --- src/ng/compile.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/ng/compile.js b/src/ng/compile.js index 792a2ea4fd3f..c374468d69c9 100644 --- a/src/ng/compile.js +++ b/src/ng/compile.js @@ -93,7 +93,7 @@ var NON_ASSIGNABLE_MODEL_EXPRESSION = 'Non-assignable model expression: '; * * * @param {string|Element} element Element or HTML string to compile into a template function. - * @param {function(angular.Scope[, cloneAttachFn])} transclude function available to directives. + * @param {function(angular.Scope[, cloneAttachFn]} transclude function available to directives. * @param {number} maxPriority only apply directives lower then given priority (Only effects the * root element(s), not their children) * @returns {function(scope[, cloneAttachFn])} a link function which is used to bind template @@ -361,7 +361,7 @@ function $CompileProvider($provide) { * function, which is the a linking function for the node. * * @param {NodeList} nodeList an array of nodes to compile - * @param {function(angular.Scope[, cloneAttachFn])} transcludeFn A linking function, where the + * @param {function(angular.Scope[, cloneAttachFn]} transcludeFn A linking function, where the * scope argument is auto-generated to the new child of the transcluded parent scope. * @param {Element=} $rootElement If the nodeList is the root of the compilation tree then the * rootElement must be set the jqLite collection of the compile root. This is @@ -520,7 +520,7 @@ function $CompileProvider($provide) { * this needs to be pre-sorted by priority order. * @param {Node} compileNode The raw DOM node to apply the compile functions to * @param {Object} templateAttrs The shared attribute function - * @param {function(angular.Scope[, cloneAttachFn])} transcludeFn A linking function, where the + * @param {function(angular.Scope[, cloneAttachFn]} transcludeFn A linking function, where the * scope argument is auto-generated to the new child of the transcluded parent scope. * @param {Element} $rootElement If we are working on the root of the compile tree then this * argument has the root jqLite array so that we can replace widgets on it. From 62fa301d1646b23c0089ec0f04989550817b45a5 Mon Sep 17 00:00:00 2001 From: Ben McCann Date: Sat, 15 Dec 2012 23:25:48 -0800 Subject: [PATCH 23/36] Fix regression in padNumber --- src/ng/filter/filters.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ng/filter/filters.js b/src/ng/filter/filters.js index 48529025e82e..21ab14510821 100644 --- a/src/ng/filter/filters.js +++ b/src/ng/filter/filters.js @@ -192,7 +192,7 @@ function padNumber(num, digits, trim) { var str = '' + num; while(str.length < digits) str = '0' + str; if (trim) - str = str.substr(num.length - digits); + str = str.substr(str.length - digits); return neg + str; } From 21da8ae59add6cf47411db96a6ead10aff5c2c2f Mon Sep 17 00:00:00 2001 From: Ben McCann Date: Sat, 15 Dec 2012 23:33:04 -0800 Subject: [PATCH 24/36] Add back in missing parens --- src/ng/compile.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/ng/compile.js b/src/ng/compile.js index c374468d69c9..792a2ea4fd3f 100644 --- a/src/ng/compile.js +++ b/src/ng/compile.js @@ -93,7 +93,7 @@ var NON_ASSIGNABLE_MODEL_EXPRESSION = 'Non-assignable model expression: '; * * * @param {string|Element} element Element or HTML string to compile into a template function. - * @param {function(angular.Scope[, cloneAttachFn]} transclude function available to directives. + * @param {function(angular.Scope[, cloneAttachFn])} transclude function available to directives. * @param {number} maxPriority only apply directives lower then given priority (Only effects the * root element(s), not their children) * @returns {function(scope[, cloneAttachFn])} a link function which is used to bind template @@ -361,7 +361,7 @@ function $CompileProvider($provide) { * function, which is the a linking function for the node. * * @param {NodeList} nodeList an array of nodes to compile - * @param {function(angular.Scope[, cloneAttachFn]} transcludeFn A linking function, where the + * @param {function(angular.Scope[, cloneAttachFn])} transcludeFn A linking function, where the * scope argument is auto-generated to the new child of the transcluded parent scope. * @param {Element=} $rootElement If the nodeList is the root of the compilation tree then the * rootElement must be set the jqLite collection of the compile root. This is @@ -520,7 +520,7 @@ function $CompileProvider($provide) { * this needs to be pre-sorted by priority order. * @param {Node} compileNode The raw DOM node to apply the compile functions to * @param {Object} templateAttrs The shared attribute function - * @param {function(angular.Scope[, cloneAttachFn]} transcludeFn A linking function, where the + * @param {function(angular.Scope[, cloneAttachFn])} transcludeFn A linking function, where the * scope argument is auto-generated to the new child of the transcluded parent scope. * @param {Element} $rootElement If we are working on the root of the compile tree then this * argument has the root jqLite array so that we can replace widgets on it. From d7e27dd9c55916bdd8b46e9dbf5a960062b5c8e7 Mon Sep 17 00:00:00 2001 From: Ben McCann Date: Sat, 15 Dec 2012 23:37:56 -0800 Subject: [PATCH 25/36] Add jsdocs specifying some jsLite args as optional --- src/jqLite.js | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/src/jqLite.js b/src/jqLite.js index 5f0dbf1a160a..54b510d32e32 100644 --- a/src/jqLite.js +++ b/src/jqLite.js @@ -112,6 +112,10 @@ function camelCase(name) { // ///////////////////////////////////////////// +/** + * @param {string} name + * @param {Object=} dispatchThis + */ function JQLitePatchJQueryRemove(name, dispatchThis) { var originalJqFn = jQuery.fn[name]; originalJqFn = originalJqFn.$original || originalJqFn; @@ -146,6 +150,7 @@ function JQLitePatchJQueryRemove(name, dispatchThis) { } ///////////////////////////////////////////// + /** * @constructor */ @@ -184,6 +189,11 @@ function JQLiteDealoc(element){ } } +/** + * @param {Object} element + * @param {string=} type + * @param {function()=} fn + */ function JQLiteUnbind(element, type, fn) { var events = JQLiteExpandoStore(element, 'events'), handle = JQLiteExpandoStore(element, 'handle'); @@ -219,6 +229,11 @@ function JQLiteRemoveData(element) { } } +/** + * @param {Object} element + * @param {string} key + * @param {*=} value + */ function JQLiteExpandoStore(element, key, value) { var expandoId = element[jqName], expandoStore = jqCache[expandoId || -1]; @@ -302,6 +317,11 @@ function JQLiteController(element, name) { return JQLiteInheritedData(element, '$' + (name || 'ngController' ) + 'Controller'); } +/** + * @param {Object} element + * @param {string} name + * @param {*=} value + */ function JQLiteInheritedData(element, name, value) { element = jqLite(element); From 378e7d2ace375715685fa1efd20bbbe680a4b558 Mon Sep 17 00:00:00 2001 From: Ben McCann Date: Sun, 16 Dec 2012 00:16:15 -0800 Subject: [PATCH 26/36] More jsdocs for function types --- src/Angular.js | 11 ++++++++++- src/ng/browser.js | 2 +- src/ng/directive/form.js | 6 +++++- src/ng/directive/input.js | 6 +++++- src/ng/location.js | 4 ++++ src/ng/parse.js | 11 +++++++++++ 6 files changed, 36 insertions(+), 4 deletions(-) diff --git a/src/Angular.js b/src/Angular.js index fc7f37404634..758bb91483ef 100644 --- a/src/Angular.js +++ b/src/Angular.js @@ -184,6 +184,7 @@ function nextUid() { * to `dst`. You can specify multiple `src` objects. * * @param {Object} dst Destination object. + * @param {...*} var_args */ function extend(dst, var_args) { forEach(arguments, function(obj){ @@ -961,6 +962,9 @@ function bindJQuery() { /** * throw error of the argument is falsy. + * @param {*} arg + * @param {string=} name + * @param {string=} reason */ function assertArg(arg, name, reason) { if (!arg) { @@ -969,7 +973,12 @@ function assertArg(arg, name, reason) { return arg; } -function assertArgFn(arg, name, acceptArrayAnnotation) { +/** + * @param {*} arg + * @param {string} name + * @param {boolean=} acceptArrayAnnotation + */ + function assertArgFn(arg, name, acceptArrayAnnotation) { if (acceptArrayAnnotation && isArray(arg)) { arg = arg[arg.length - 1]; } diff --git a/src/ng/browser.js b/src/ng/browser.js index 6d0f315d3333..482d682cae6c 100644 --- a/src/ng/browser.js +++ b/src/ng/browser.js @@ -143,7 +143,7 @@ function Browser(window, document, $log, $sniffer) { * NOTE: this api is intended for use only by the $location service. Please use the * {@link ng.$location $location service} to change url. * - * @param {string} url New url (when used as setter) + * @param {string=} url New url (when used as setter) * @param {boolean=} replace Should new url replace current history record ? */ self.url = function(url, replace) { diff --git a/src/ng/directive/form.js b/src/ng/directive/form.js index b4d500c6e76c..c5688684e4cf 100644 --- a/src/ng/directive/form.js +++ b/src/ng/directive/form.js @@ -54,7 +54,11 @@ function FormController(element, attrs) { element.addClass(PRISTINE_CLASS); toggleValidCss(true); - // convenience method for easy toggling of classes + /** + * Convenience method for easy toggling of classes + * @param {boolean} isValid + * @param {string=} validationErrorKey + */ function toggleValidCss(isValid, validationErrorKey) { validationErrorKey = validationErrorKey ? '-' + snake_case(validationErrorKey, '-') : ''; element. diff --git a/src/ng/directive/input.js b/src/ng/directive/input.js index e675fdfd090a..0b64e21905bb 100644 --- a/src/ng/directive/input.js +++ b/src/ng/directive/input.js @@ -929,7 +929,11 @@ var NgModelController = ['$scope', '$exceptionHandler', '$attrs', '$element', '$ $element.addClass(PRISTINE_CLASS); toggleValidCss(true); - // convenience method for easy toggling of classes + /** + * Convenience method for easy toggling of classes + * @param {boolean} isValid + * @param {string=} validationErrorKey + */ function toggleValidCss(isValid, validationErrorKey) { validationErrorKey = validationErrorKey ? '-' + snake_case(validationErrorKey, '-') : ''; $element. diff --git a/src/ng/location.js b/src/ng/location.js index 7409e390a065..80594d1c9271 100644 --- a/src/ng/location.js +++ b/src/ng/location.js @@ -28,6 +28,10 @@ function stripHash(url) { } +/** + * @param {string} url + * @param {Object=} obj + */ function matchUrl(url, obj) { var match = URL_MATCH.exec(url); diff --git a/src/ng/parse.js b/src/ng/parse.js index 97aba1130364..ad77fd1088e4 100644 --- a/src/ng/parse.js +++ b/src/ng/parse.js @@ -113,6 +113,11 @@ function lex(text, csp){ return ch == '-' || ch == '+' || isNumber(ch); } + /** + * @param {string} error + * @param {number=} start + * @param {number=} end + */ function throwError(error, start, end) { end = end || index; throw Error("Lexer Error: " + error + " at column" + @@ -323,6 +328,12 @@ function parser(text, json, $filter, csp){ return false; } + /** + * @param {string=} e1 + * @param {string=} e2 + * @param {string=} e3 + * @param {string=} e4 + */ function expect(e1, e2, e3, e4){ var token = peek(e1, e2, e3, e4); if (token) { From 4f0b1385775ca4569037166e5246cea655114043 Mon Sep 17 00:00:00 2001 From: Ben McCann Date: Sun, 16 Dec 2012 00:18:41 -0800 Subject: [PATCH 27/36] Fix startPoller jsdoc --- src/ng/browser.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/ng/browser.js b/src/ng/browser.js index 482d682cae6c..61134e420914 100644 --- a/src/ng/browser.js +++ b/src/ng/browser.js @@ -106,7 +106,8 @@ function Browser(window, document, $log, $sniffer) { /** * @param {number} interval How often should browser call poll functions (ms) - * @param {function()} setTimeout Reference to a real or fake `setTimeout` function. + * @param {function(function(),number)} setTimeout Reference to a real or + * fake `setTimeout` function. * * @description * Configures the poller to run in the specified intervals, using the specified From a1b8a4c57bf56099fa13dc632c57104298cccfed Mon Sep 17 00:00:00 2001 From: Ben McCann Date: Sun, 16 Dec 2012 00:20:48 -0800 Subject: [PATCH 28/36] Fix type declaration --- src/jqLite.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/jqLite.js b/src/jqLite.js index 54b510d32e32..d2b480939aa8 100644 --- a/src/jqLite.js +++ b/src/jqLite.js @@ -114,7 +114,7 @@ function camelCase(name) { /** * @param {string} name - * @param {Object=} dispatchThis + * @param {boolean=} dispatchThis */ function JQLitePatchJQueryRemove(name, dispatchThis) { var originalJqFn = jQuery.fn[name]; From 550274e33b155f7a1af203df88be6143e867766d Mon Sep 17 00:00:00 2001 From: Ben McCann Date: Sun, 16 Dec 2012 00:24:47 -0800 Subject: [PATCH 29/36] Specify types for HashMap input --- src/Angular.js | 2 +- src/apis.js | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Angular.js b/src/Angular.js index 758bb91483ef..47ff94e2e423 100644 --- a/src/Angular.js +++ b/src/Angular.js @@ -86,7 +86,7 @@ var Error = window.Error, expect(log).toEqual(['name: misko', 'gender:male']); * - * @param {Object|Array} obj Object to iterate over. + * @param {Object|Array|undefined} obj Object to iterate over. * @param {Function} iterator Iterator function. * @param {Object=} context Object to become context (`this`) for the iterator function. * @returns {Object|Array} Reference to `obj`. diff --git a/src/apis.js b/src/apis.js index cd421708ea91..e4daf82a8be3 100644 --- a/src/apis.js +++ b/src/apis.js @@ -33,6 +33,7 @@ function hashKey(obj) { /** * HashMap which can use objects as keys + * @param {(Object|Array)=} array * @constructor */ function HashMap(array){ From c10c8b48f440f1267653798a1c4a55a838432a0f Mon Sep 17 00:00:00 2001 From: Ben McCann Date: Sun, 16 Dec 2012 00:29:54 -0800 Subject: [PATCH 30/36] Change type declaration for extend --- src/Angular.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Angular.js b/src/Angular.js index 47ff94e2e423..800b6ad0b777 100644 --- a/src/Angular.js +++ b/src/Angular.js @@ -184,7 +184,7 @@ function nextUid() { * to `dst`. You can specify multiple `src` objects. * * @param {Object} dst Destination object. - * @param {...*} var_args + * @param {...Object} var_args Source object(s). */ function extend(dst, var_args) { forEach(arguments, function(obj){ From 5916155cc095c2bf508b85cb368b96f4c19febba Mon Sep 17 00:00:00 2001 From: Ben McCann Date: Sun, 16 Dec 2012 00:41:08 -0800 Subject: [PATCH 31/36] Fix Object capitalization --- src/ng/location.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ng/location.js b/src/ng/location.js index 80594d1c9271..88f7b76d4889 100644 --- a/src/ng/location.js +++ b/src/ng/location.js @@ -345,7 +345,7 @@ LocationUrl.prototype = { * * Change search part when called with parameter and return `$location`. * - * @param {string|object=} search New search params - string or hash object + * @param {string|Object=} search New search params - string or hash object * @param {string=} paramValue If `search` is a string, then `paramValue` will override only a * single search parameter. If the value is `null`, the parameter will be deleted. * From ea336b486d776aec5d8899d5897960182de761f9 Mon Sep 17 00:00:00 2001 From: Ben McCann Date: Sun, 16 Dec 2012 00:44:27 -0800 Subject: [PATCH 32/36] Fix invalid type declaration --- src/ng/parse.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ng/parse.js b/src/ng/parse.js index ad77fd1088e4..9cf4a35c8fb5 100644 --- a/src/ng/parse.js +++ b/src/ng/parse.js @@ -679,7 +679,7 @@ function setter(obj, path, setValue) { * Return the value accesible from the object by path. Any undefined traversals are ignored * @param {Object} obj starting object * @param {string} path path to traverse - * @param {boolean=true} bindFnToScope + * @param {boolean} bindFnToScope * @returns value as accesbile by path */ //TODO(misko): this function needs to be removed From e730c510779496a838e04cf0314f062d7b7784e8 Mon Sep 17 00:00:00 2001 From: Ben McCann Date: Sun, 16 Dec 2012 00:48:25 -0800 Subject: [PATCH 33/36] jsdoc was on wrong expression --- src/ng/directive/ngSwitch.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/ng/directive/ngSwitch.js b/src/ng/directive/ngSwitch.js index 0c9e2a8db26c..56df176451ca 100644 --- a/src/ng/directive/ngSwitch.js +++ b/src/ng/directive/ngSwitch.js @@ -1,5 +1,7 @@ 'use strict'; +var NG_SWITCH = 'ng-switch'; + /** * @ngdoc directive * @name ng.directive:ngSwitch @@ -59,7 +61,6 @@ */ -var NG_SWITCH = 'ng-switch'; var ngSwitchDirective = valueFn({ restrict: 'EA', compile: function(element, attr) { From 7baae2199cc98ad05e3a7333ee96c018a617d159 Mon Sep 17 00:00:00 2001 From: Ben McCann Date: Sun, 16 Dec 2012 13:15:07 -0800 Subject: [PATCH 34/36] Fix a couple of warnings related to possible undefined values --- src/Angular.js | 2 +- src/ng/browser.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Angular.js b/src/Angular.js index 800b6ad0b777..d99c51d7db7b 100644 --- a/src/Angular.js +++ b/src/Angular.js @@ -89,7 +89,7 @@ var Error = window.Error, * @param {Object|Array|undefined} obj Object to iterate over. * @param {Function} iterator Iterator function. * @param {Object=} context Object to become context (`this`) for the iterator function. - * @returns {Object|Array} Reference to `obj`. + * @returns {Object|Array|undefined} Reference to `obj`. */ function forEach(obj, iterator, context) { var key; diff --git a/src/ng/browser.js b/src/ng/browser.js index 61134e420914..8f704e5db61c 100644 --- a/src/ng/browser.js +++ b/src/ng/browser.js @@ -272,7 +272,7 @@ function Browser(window, document, $log, $sniffer) { var cookieLength, cookieArray, cookie, i, index; if (name) { - if (value === undefined) { + if (!value) { rawDocument.cookie = escape(name) + "=;path=" + cookiePath + ";expires=Thu, 01 Jan 1970 00:00:00 GMT"; } else { if (isString(value)) { From 8f87116b7a139b3767dc7ba6932d34ee5fd090a7 Mon Sep 17 00:00:00 2001 From: Ben McCann Date: Sun, 16 Dec 2012 13:34:18 -0800 Subject: [PATCH 35/36] Fix parameter type --- src/ng/compile.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/ng/compile.js b/src/ng/compile.js index 792a2ea4fd3f..f5f87dead3d8 100644 --- a/src/ng/compile.js +++ b/src/ng/compile.js @@ -1042,10 +1042,10 @@ function $CompileProvider($provide) { * This is a special jqLite.replaceWith, which can replace items which * have no parents, provided that the containing jqLite collection is provided. * - * @param {JqLite} $rootElement The root of the compile tree. Used so that we can replace nodes - * in the root of the tree. - * @param {JqLite} $element The jqLite element which we are going to replace. We keep the shell, - * but replace its DOM node reference. + * @param {Element} $rootElement The root of the compile tree. Used so that + * we can replace nodes in the root of the tree. + * @param {Element} $element The jqLite element which we are going to + * replace. We keep the shell, but replace its DOM node reference. * @param {Node} newNode The new DOM node. */ function replaceWith($rootElement, $element, newNode) { From 07d0f767fbb47540696f75422fd087ec76191754 Mon Sep 17 00:00:00 2001 From: Ben McCann Date: Sun, 16 Dec 2012 13:43:12 -0800 Subject: [PATCH 36/36] Remove unnecessary @returns statement --- src/ng/rootScope.js | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/ng/rootScope.js b/src/ng/rootScope.js index 4fe7cb89ca11..8fb28faac37b 100644 --- a/src/ng/rootScope.js +++ b/src/ng/rootScope.js @@ -119,8 +119,6 @@ function $RootScopeProvider(){ expect(parent.salutation).toEqual('Hello'); * * - * - * @returns {Object} Newly created scope. * @constructor */ function Scope() {