summaryrefslogtreecommitdiff
path: root/xstatic/pkg/angular/data/angular-loader.js
diff options
context:
space:
mode:
Diffstat (limited to 'xstatic/pkg/angular/data/angular-loader.js')
-rw-r--r--xstatic/pkg/angular/data/angular-loader.js71
1 files changed, 32 insertions, 39 deletions
diff --git a/xstatic/pkg/angular/data/angular-loader.js b/xstatic/pkg/angular/data/angular-loader.js
index 7bf81bb..2ef986c 100644
--- a/xstatic/pkg/angular/data/angular-loader.js
+++ b/xstatic/pkg/angular/data/angular-loader.js
@@ -1,5 +1,5 @@
/**
- * @license AngularJS v1.2.16
+ * @license AngularJS v1.3.7
* (c) 2010-2014 Google, Inc. http://angularjs.org
* License: MIT
*/
@@ -31,52 +31,37 @@
* should all be static strings, not variables or general expressions.
*
* @param {string} module The namespace to use for the new minErr instance.
+ * @param {function} ErrorConstructor Custom error constructor to be instantiated when returning
+ * error from returned function, for cases when a particular type of error is useful.
* @returns {function(code:string, template:string, ...templateArgs): Error} minErr instance
*/
-function minErr(module) {
- return function () {
+function minErr(module, ErrorConstructor) {
+ ErrorConstructor = ErrorConstructor || Error;
+ return function() {
var code = arguments[0],
prefix = '[' + (module ? module + ':' : '') + code + '] ',
template = arguments[1],
templateArgs = arguments,
- stringify = function (obj) {
- if (typeof obj === 'function') {
- return obj.toString().replace(/ \{[\s\S]*$/, '');
- } else if (typeof obj === 'undefined') {
- return 'undefined';
- } else if (typeof obj !== 'string') {
- return JSON.stringify(obj);
- }
- return obj;
- },
+
message, i;
- message = prefix + template.replace(/\{\d+\}/g, function (match) {
+ message = prefix + template.replace(/\{\d+\}/g, function(match) {
var index = +match.slice(1, -1), arg;
if (index + 2 < templateArgs.length) {
- arg = templateArgs[index + 2];
- if (typeof arg === 'function') {
- return arg.toString().replace(/ ?\{[\s\S]*$/, '');
- } else if (typeof arg === 'undefined') {
- return 'undefined';
- } else if (typeof arg !== 'string') {
- return toJson(arg);
- }
- return arg;
+ return toDebugString(templateArgs[index + 2]);
}
return match;
});
- message = message + '\nhttp://errors.angularjs.org/1.2.16/' +
+ message = message + '\nhttp://errors.angularjs.org/1.3.7/' +
(module ? module + '/' : '') + code;
for (i = 2; i < arguments.length; i++) {
- message = message + (i == 2 ? '?' : '&') + 'p' + (i-2) + '=' +
- encodeURIComponent(stringify(arguments[i]));
+ message = message + (i == 2 ? '?' : '&') + 'p' + (i - 2) + '=' +
+ encodeURIComponent(toDebugString(arguments[i]));
}
-
- return new Error(message);
+ return new ErrorConstructor(message);
};
}
@@ -124,7 +109,7 @@ function setupModuleLoader(window) {
*
* # Module
*
- * A module is a collection of services, directives, filters, and configuration information.
+ * A module is a collection of services, directives, controllers, filters, and configuration information.
* `angular.module` is used to configure the {@link auto.$injector $injector}.
*
* ```js
@@ -152,9 +137,9 @@ 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.<string>=} requires If specified then new module is being created. If
->>>>>* unspecified then the module is being retrieved for further configuration.
- * @param {Function} configFn Optional configuration function for the module. Same as
+ * @param {!Array.<string>=} requires If specified then new module is being created. If
+ * unspecified then 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()}.
* @returns {module} new module with the {@link angular.Module} api.
*/
@@ -180,21 +165,25 @@ function setupModuleLoader(window) {
var invokeQueue = [];
/** @type {!Array.<Function>} */
+ var configBlocks = [];
+
+ /** @type {!Array.<Function>} */
var runBlocks = [];
- var config = invokeLater('$injector', 'invoke');
+ var config = invokeLater('$injector', 'invoke', 'push', configBlocks);
/** @type {angular.Module} */
var moduleInstance = {
// Private state
_invokeQueue: invokeQueue,
+ _configBlocks: configBlocks,
_runBlocks: runBlocks,
/**
* @ngdoc property
* @name angular.Module#requires
* @module ng
- * @returns {Array.<string>} List of module names which must be loaded before this module.
+ *
* @description
* Holds the list of modules which the injector will load before the current module is
* loaded.
@@ -205,8 +194,9 @@ function setupModuleLoader(window) {
* @ngdoc property
* @name angular.Module#name
* @module ng
- * @returns {string} Name of the module.
+ *
* @description
+ * Name of the module.
*/
name: name,
@@ -297,7 +287,7 @@ function setupModuleLoader(window) {
* })
* ```
*
- * See {@link ngAnimate.$animateProvider#register $animateProvider.register()} and
+ * See {@link ng.$animateProvider#register $animateProvider.register()} and
* {@link ngAnimate ngAnimate module} for more information.
*/
animation: invokeLater('$animateProvider', 'register'),
@@ -346,6 +336,8 @@ function setupModuleLoader(window) {
* configuration.
* @description
* Use this method to register work which needs to be performed on module loading.
+ * For more about how to configure services, see
+ * {@link providers#provider-recipe Provider Recipe}.
*/
config: config,
@@ -369,7 +361,7 @@ function setupModuleLoader(window) {
config(configFn);
}
- return moduleInstance;
+ return moduleInstance;
/**
* @param {string} provider
@@ -377,9 +369,10 @@ function setupModuleLoader(window) {
* @param {String=} insertMethod
* @returns {angular.Module}
*/
- function invokeLater(provider, method, insertMethod) {
+ function invokeLater(provider, method, insertMethod, queue) {
+ if (!queue) queue = invokeQueue;
return function() {
- invokeQueue[insertMethod || 'push']([provider, method, arguments]);
+ queue[insertMethod || 'push']([provider, method, arguments]);
return moduleInstance;
};
}