Skip to content

Commit 830a1ab

Browse files
16986d8 test(angular_1_router): apply annotations to controller constructors
1 parent 6d0ecff commit 830a1ab

193 files changed

Lines changed: 1098 additions & 686 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

BUILD_INFO

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
Wed Mar 9 18:02:41 UTC 2016
2-
8d2b8db738314f4f3e3f583b0f4c1c0956ed188b
1+
Wed Mar 9 21:58:57 UTC 2016
2+
16986d8aa7c17cea8ec7cb8c9a1818aec947db87

bundles/angular2-all-testing.umd.dev.js

Lines changed: 66 additions & 28 deletions
Large diffs are not rendered by default.

bundles/angular2-all.umd.dev.js

Lines changed: 63 additions & 25 deletions
Large diffs are not rendered by default.

bundles/angular2-all.umd.js

Lines changed: 62 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -11112,6 +11112,7 @@ return /******/ (function(modules) { // webpackBootstrap
1111211112
var lang_1 = __webpack_require__(5);
1111311113
var promise_1 = __webpack_require__(48);
1111411114
exports.PromiseWrapper = promise_1.PromiseWrapper;
11115+
exports.PromiseCompleter = promise_1.PromiseCompleter;
1111511116
var Subject_1 = __webpack_require__(49);
1111611117
var PromiseObservable_1 = __webpack_require__(50);
1111711118
var toPromise_1 = __webpack_require__(65);
@@ -11257,6 +11258,17 @@ return /******/ (function(modules) { // webpackBootstrap
1125711258
/* 48 */
1125811259
/***/ function(module, exports) {
1125911260

11261+
var PromiseCompleter = (function () {
11262+
function PromiseCompleter() {
11263+
var _this = this;
11264+
this.promise = new Promise(function (res, rej) {
11265+
_this.resolve = res;
11266+
_this.reject = rej;
11267+
});
11268+
}
11269+
return PromiseCompleter;
11270+
})();
11271+
exports.PromiseCompleter = PromiseCompleter;
1126011272
var PromiseWrapper = (function () {
1126111273
function PromiseWrapper() {
1126211274
}
@@ -11289,15 +11301,7 @@ return /******/ (function(modules) { // webpackBootstrap
1128911301
PromiseWrapper.then(PromiseWrapper.resolve(null), computation, function (_) { });
1129011302
};
1129111303
PromiseWrapper.isPromise = function (obj) { return obj instanceof Promise; };
11292-
PromiseWrapper.completer = function () {
11293-
var resolve;
11294-
var reject;
11295-
var p = new Promise(function (res, rej) {
11296-
resolve = res;
11297-
reject = rej;
11298-
});
11299-
return { promise: p, resolve: resolve, reject: reject };
11300-
};
11304+
PromiseWrapper.completer = function () { return new PromiseCompleter(); };
1130111305
return PromiseWrapper;
1130211306
})();
1130311307
exports.PromiseWrapper = PromiseWrapper;
@@ -13355,7 +13359,7 @@ return /******/ (function(modules) { // webpackBootstrap
1335513359
* Retrieve the platform {@link Injector}, which is the parent injector for
1335613360
* every Angular application on the page and provides singleton providers.
1335713361
*/
13358-
get: function () { return exceptions_1.unimplemented(); },
13362+
get: function () { throw exceptions_1.unimplemented(); },
1335913363
enumerable: true,
1336013364
configurable: true
1336113365
});
@@ -13576,12 +13580,12 @@ return /******/ (function(modules) { // webpackBootstrap
1357613580
completer.reject(e, e.stack);
1357713581
}
1357813582
});
13579-
return completer.promise.then(function (_) {
13583+
return completer.promise.then(function (ref) {
1358013584
var c = _this._injector.get(console_1.Console);
1358113585
if (lang_1.assertionsEnabled()) {
1358213586
c.log("Angular 2 is running in the development mode. Call enableProdMode() to enable the production mode.");
1358313587
}
13584-
return _;
13588+
return ref;
1358513589
});
1358613590
};
1358713591
/** @internal */
@@ -18305,7 +18309,7 @@ return /******/ (function(modules) { // webpackBootstrap
1830518309
if (args === void 0) { args = null; }
1830618310
var key;
1830718311
var valueStr;
18308-
var pluralMap = args[0];
18312+
var pluralMap = (args[0]);
1830918313
if (!lang_1.isStringMap(pluralMap)) {
1831018314
throw new invalid_pipe_argument_exception_1.InvalidPipeArgumentException(I18nPluralPipe, pluralMap);
1831118315
}
@@ -18375,7 +18379,7 @@ return /******/ (function(modules) { // webpackBootstrap
1837518379
}
1837618380
I18nSelectPipe.prototype.transform = function (value, args) {
1837718381
if (args === void 0) { args = null; }
18378-
var mapping = args[0];
18382+
var mapping = (args[0]);
1837918383
if (!lang_1.isStringMap(mapping)) {
1838018384
throw new invalid_pipe_argument_exception_1.InvalidPipeArgumentException(I18nSelectPipe, mapping);
1838118385
}
@@ -19550,15 +19554,16 @@ return /******/ (function(modules) { // webpackBootstrap
1955019554
this._parent.updateValueAndValidity({ onlySelf: onlySelf, emitEvent: emitEvent });
1955119555
}
1955219556
};
19553-
AbstractControl.prototype._runValidator = function () { return lang_1.isPresent(this.validator) ? this.validator(this) : null; };
19557+
AbstractControl.prototype._runValidator = function () {
19558+
return lang_1.isPresent(this.validator) ? this.validator(this) : null;
19559+
};
1955419560
AbstractControl.prototype._runAsyncValidator = function (emitEvent) {
1955519561
var _this = this;
1955619562
if (lang_1.isPresent(this.asyncValidator)) {
1955719563
this._status = exports.PENDING;
1955819564
this._cancelExistingSubscription();
1955919565
var obs = toObservable(this.asyncValidator(this));
19560-
this._asyncValidationSubscription =
19561-
async_1.ObservableWrapper.subscribe(obs, function (res) { return _this.setErrors(res, { emitEvent: emitEvent }); });
19566+
this._asyncValidationSubscription = async_1.ObservableWrapper.subscribe(obs, function (res) { return _this.setErrors(res, { emitEvent: emitEvent }); });
1956219567
}
1956319568
};
1956419569
AbstractControl.prototype._cancelExistingSubscription = function () {
@@ -20275,7 +20280,8 @@ return /******/ (function(modules) { // webpackBootstrap
2027520280
}
2027620281
exports.composeValidators = composeValidators;
2027720282
function composeAsyncValidators(validators) {
20278-
return lang_1.isPresent(validators) ? validators_1.Validators.composeAsync(validators.map(normalize_validator_1.normalizeValidator)) : null;
20283+
return lang_1.isPresent(validators) ? validators_1.Validators.composeAsync(validators.map(normalize_validator_1.normalizeAsyncValidator)) :
20284+
null;
2027920285
}
2028020286
exports.composeAsyncValidators = composeAsyncValidators;
2028120287
function isPropertyUpdated(changes, viewModel) {
@@ -20439,7 +20445,7 @@ return /******/ (function(modules) { // webpackBootstrap
2043920445
if (presentValidators.length == 0)
2044020446
return null;
2044120447
return function (control) {
20442-
var promises = _executeValidators(control, presentValidators).map(_convertToPromise);
20448+
var promises = _executeAsyncValidators(control, presentValidators).map(_convertToPromise);
2044320449
return promise_1.PromiseWrapper.all(promises).then(_mergeErrors);
2044420450
};
2044520451
};
@@ -20452,6 +20458,9 @@ return /******/ (function(modules) { // webpackBootstrap
2045220458
function _executeValidators(control, validators) {
2045320459
return validators.map(function (v) { return v(control); });
2045420460
}
20461+
function _executeAsyncValidators(control, validators) {
20462+
return validators.map(function (v) { return v(control); });
20463+
}
2045520464
function _mergeErrors(arrayOfErrors) {
2045620465
var res = arrayOfErrors.reduce(function (res, errors) {
2045720466
return lang_1.isPresent(errors) ? collection_1.StringMapWrapper.merge(res, errors) : res;
@@ -20840,6 +20849,15 @@ return /******/ (function(modules) { // webpackBootstrap
2084020849
}
2084120850
}
2084220851
exports.normalizeValidator = normalizeValidator;
20852+
function normalizeAsyncValidator(validator) {
20853+
if (validator.validate !== undefined) {
20854+
return function (c) { return Promise.resolve(validator.validate(c)); };
20855+
}
20856+
else {
20857+
return validator;
20858+
}
20859+
}
20860+
exports.normalizeAsyncValidator = normalizeAsyncValidator;
2084320861

2084420862

2084520863
/***/ },
@@ -22021,7 +22039,7 @@ return /******/ (function(modules) { // webpackBootstrap
2202122039
FormBuilder.prototype.group = function (controlsConfig, extra) {
2202222040
if (extra === void 0) { extra = null; }
2202322041
var controls = this._reduceControls(controlsConfig);
22024-
var optionals = lang_1.isPresent(extra) ? collection_1.StringMapWrapper.get(extra, "optionals") : null;
22042+
var optionals = (lang_1.isPresent(extra) ? collection_1.StringMapWrapper.get(extra, "optionals") : null);
2202522043
var validator = lang_1.isPresent(extra) ? collection_1.StringMapWrapper.get(extra, "validator") : null;
2202622044
var asyncValidator = lang_1.isPresent(extra) ? collection_1.StringMapWrapper.get(extra, "asyncValidator") : null;
2202722045
return new modelModule.ControlGroup(controls, optionals, validator, asyncValidator);
@@ -25968,7 +25986,9 @@ return /******/ (function(modules) { // webpackBootstrap
2596825986
collection_1.StringMapWrapper.forEach(data, function (value, name) { entryArray.push([name, value]); });
2596925987
// We need to sort to get a defined output order
2597025988
// for tests and for caching generated artifacts...
25971-
collection_1.ListWrapper.sort(entryArray, function (entry1, entry2) { return lang_1.StringWrapper.compare(entry1[0], entry2[0]); });
25989+
collection_1.ListWrapper.sort(entryArray, function (entry1, entry2) {
25990+
return lang_1.StringWrapper.compare(entry1[0], entry2[0]);
25991+
});
2597225992
var keyValueArray = [];
2597325993
entryArray.forEach(function (entry) { keyValueArray.push([entry[0], entry[1]]); });
2597425994
return keyValueArray;
@@ -27958,6 +27978,8 @@ return /******/ (function(modules) { // webpackBootstrap
2795827978
// see http://www.w3.org/TR/html51/syntax.html#optional-tags
2795927979
// This implementation does not fully conform to the HTML5 spec.
2796027980
var TAG_DEFINITIONS = {
27981+
'base': new HtmlTagDefinition({ isVoid: true }),
27982+
'meta': new HtmlTagDefinition({ isVoid: true }),
2796127983
'area': new HtmlTagDefinition({ isVoid: true }),
2796227984
'embed': new HtmlTagDefinition({ isVoid: true }),
2796327985
'link': new HtmlTagDefinition({ isVoid: true }),
@@ -29111,9 +29133,9 @@ return /******/ (function(modules) { // webpackBootstrap
2911129133
var mc = new Hammer(element);
2911229134
mc.get('pinch').set({ enable: true });
2911329135
mc.get('rotate').set({ enable: true });
29114-
var handler = function (eventObj) { zone.run(function () { handler(eventObj); }); };
29115-
mc.on(eventName, handler);
29116-
return function () { mc.off(eventName, handler); };
29136+
var callback = function (eventObj) { zone.run(function () { handler(eventObj); }); };
29137+
mc.on(eventName, callback);
29138+
return function () { mc.off(eventName, callback); };
2911729139
});
2911829140
};
2911929141
HammerGesturesPlugin = __decorate([
@@ -33911,6 +33933,7 @@ return /******/ (function(modules) { // webpackBootstrap
3391133933
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
3391233934
};
3391333935
var lang_1 = __webpack_require__(5);
33936+
var __make_dart_analyzer_happy = null;
3391433937
/**
3391533938
* The `RouteConfig` decorator defines routes for a given component.
3391633939
*
@@ -36123,6 +36146,21 @@ return /******/ (function(modules) { // webpackBootstrap
3612336146
var PlatformLocation = (function () {
3612436147
function PlatformLocation() {
3612536148
}
36149+
Object.defineProperty(PlatformLocation.prototype, "pathname", {
36150+
/* abstract */ get: function () { return null; },
36151+
enumerable: true,
36152+
configurable: true
36153+
});
36154+
Object.defineProperty(PlatformLocation.prototype, "search", {
36155+
/* abstract */ get: function () { return null; },
36156+
enumerable: true,
36157+
configurable: true
36158+
});
36159+
Object.defineProperty(PlatformLocation.prototype, "hash", {
36160+
/* abstract */ get: function () { return null; },
36161+
enumerable: true,
36162+
configurable: true
36163+
});
3612636164
return PlatformLocation;
3612736165
})();
3612836166
exports.PlatformLocation = PlatformLocation;

bundles/angular2-all.umd.min.js

Lines changed: 19 additions & 19 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

bundles/angular2.dev.js

Lines changed: 41 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -2078,6 +2078,17 @@ System.register("angular2/src/facade/promise", [], true, function(require, expor
20782078
var global = System.global,
20792079
__define = global.define;
20802080
global.define = undefined;
2081+
var PromiseCompleter = (function() {
2082+
function PromiseCompleter() {
2083+
var _this = this;
2084+
this.promise = new Promise(function(res, rej) {
2085+
_this.resolve = res;
2086+
_this.reject = rej;
2087+
});
2088+
}
2089+
return PromiseCompleter;
2090+
})();
2091+
exports.PromiseCompleter = PromiseCompleter;
20812092
var PromiseWrapper = (function() {
20822093
function PromiseWrapper() {}
20832094
PromiseWrapper.resolve = function(obj) {
@@ -2113,17 +2124,7 @@ System.register("angular2/src/facade/promise", [], true, function(require, expor
21132124
return obj instanceof Promise;
21142125
};
21152126
PromiseWrapper.completer = function() {
2116-
var resolve;
2117-
var reject;
2118-
var p = new Promise(function(res, rej) {
2119-
resolve = res;
2120-
reject = rej;
2121-
});
2122-
return {
2123-
promise: p,
2124-
resolve: resolve,
2125-
reject: reject
2126-
};
2127+
return new PromiseCompleter();
21272128
};
21282129
return PromiseWrapper;
21292130
})();
@@ -12503,7 +12504,7 @@ System.register("angular2/src/core/application_ref", ["angular2/src/core/zone/ng
1250312504
function PlatformRef() {}
1250412505
Object.defineProperty(PlatformRef.prototype, "injector", {
1250512506
get: function() {
12506-
return exceptions_1.unimplemented();
12507+
throw exceptions_1.unimplemented();
1250712508
},
1250812509
enumerable: true,
1250912510
configurable: true
@@ -12720,12 +12721,12 @@ System.register("angular2/src/core/application_ref", ["angular2/src/core/zone/ng
1272012721
completer.reject(e, e.stack);
1272112722
}
1272212723
});
12723-
return completer.promise.then(function(_) {
12724+
return completer.promise.then(function(ref) {
1272412725
var c = _this._injector.get(console_1.Console);
1272512726
if (lang_1.assertionsEnabled()) {
1272612727
c.log("Angular 2 is running in the development mode. Call enableProdMode() to enable the production mode.");
1272712728
}
12728-
return _;
12729+
return ref;
1272912730
});
1273012731
};
1273112732
ApplicationRef_.prototype._loadComponent = function(componentRef) {
@@ -13091,6 +13092,7 @@ System.register("angular2/src/facade/async", ["angular2/src/facade/lang", "angul
1309113092
var lang_1 = require("angular2/src/facade/lang");
1309213093
var promise_1 = require("angular2/src/facade/promise");
1309313094
exports.PromiseWrapper = promise_1.PromiseWrapper;
13095+
exports.PromiseCompleter = promise_1.PromiseCompleter;
1309413096
var Subject_1 = require("rxjs/Subject");
1309513097
var PromiseObservable_1 = require("rxjs/observable/PromiseObservable");
1309613098
var toPromise_1 = require("rxjs/operator/toPromise");
@@ -14625,7 +14627,7 @@ System.register("angular2/src/common/pipes/i18n_plural_pipe", ["angular2/src/fac
1462514627
}
1462614628
var key;
1462714629
var valueStr;
14628-
var pluralMap = args[0];
14630+
var pluralMap = (args[0]);
1462914631
if (!lang_1.isStringMap(pluralMap)) {
1463014632
throw new invalid_pipe_argument_exception_1.InvalidPipeArgumentException(I18nPluralPipe, pluralMap);
1463114633
}
@@ -14674,7 +14676,7 @@ System.register("angular2/src/common/pipes/i18n_select_pipe", ["angular2/src/fac
1467414676
if (args === void 0) {
1467514677
args = null;
1467614678
}
14677-
var mapping = args[0];
14679+
var mapping = (args[0]);
1467814680
if (!lang_1.isStringMap(mapping)) {
1467914681
throw new invalid_pipe_argument_exception_1.InvalidPipeArgumentException(I18nSelectPipe, mapping);
1468014682
}
@@ -16003,7 +16005,7 @@ System.register("angular2/src/common/forms/validators", ["angular2/src/facade/la
1600316005
if (presentValidators.length == 0)
1600416006
return null;
1600516007
return function(control) {
16006-
var promises = _executeValidators(control, presentValidators).map(_convertToPromise);
16008+
var promises = _executeAsyncValidators(control, presentValidators).map(_convertToPromise);
1600716009
return promise_1.PromiseWrapper.all(promises).then(_mergeErrors);
1600816010
};
1600916011
};
@@ -16018,6 +16020,11 @@ System.register("angular2/src/common/forms/validators", ["angular2/src/facade/la
1601816020
return v(control);
1601916021
});
1602016022
}
16023+
function _executeAsyncValidators(control, validators) {
16024+
return validators.map(function(v) {
16025+
return v(control);
16026+
});
16027+
}
1602116028
function _mergeErrors(arrayOfErrors) {
1602216029
var res = arrayOfErrors.reduce(function(res, errors) {
1602316030
return lang_1.isPresent(errors) ? collection_1.StringMapWrapper.merge(res, errors) : res;
@@ -16424,6 +16431,16 @@ System.register("angular2/src/common/forms/directives/normalize_validator", [],
1642416431
}
1642516432
}
1642616433
exports.normalizeValidator = normalizeValidator;
16434+
function normalizeAsyncValidator(validator) {
16435+
if (validator.validate !== undefined) {
16436+
return function(c) {
16437+
return Promise.resolve(validator.validate(c));
16438+
};
16439+
} else {
16440+
return validator;
16441+
}
16442+
}
16443+
exports.normalizeAsyncValidator = normalizeAsyncValidator;
1642716444
global.define = __define;
1642816445
return module.exports;
1642916446
});
@@ -17281,7 +17298,7 @@ System.register("angular2/src/common/forms/form_builder", ["angular2/core", "ang
1728117298
extra = null;
1728217299
}
1728317300
var controls = this._reduceControls(controlsConfig);
17284-
var optionals = lang_1.isPresent(extra) ? collection_1.StringMapWrapper.get(extra, "optionals") : null;
17301+
var optionals = (lang_1.isPresent(extra) ? collection_1.StringMapWrapper.get(extra, "optionals") : null);
1728517302
var validator = lang_1.isPresent(extra) ? collection_1.StringMapWrapper.get(extra, "validator") : null;
1728617303
var asyncValidator = lang_1.isPresent(extra) ? collection_1.StringMapWrapper.get(extra, "asyncValidator") : null;
1728717304
return new modelModule.ControlGroup(controls, optionals, validator, asyncValidator);
@@ -19969,6 +19986,8 @@ System.register("angular2/src/compiler/html_tags", ["angular2/src/facade/lang"],
1996919986
})();
1997019987
exports.HtmlTagDefinition = HtmlTagDefinition;
1997119988
var TAG_DEFINITIONS = {
19989+
'base': new HtmlTagDefinition({isVoid: true}),
19990+
'meta': new HtmlTagDefinition({isVoid: true}),
1997219991
'area': new HtmlTagDefinition({isVoid: true}),
1997319992
'embed': new HtmlTagDefinition({isVoid: true}),
1997419993
'link': new HtmlTagDefinition({isVoid: true}),
@@ -20737,7 +20756,7 @@ System.register("angular2/src/common/forms/directives/shared", ["angular2/src/fa
2073720756
}
2073820757
exports.composeValidators = composeValidators;
2073920758
function composeAsyncValidators(validators) {
20740-
return lang_1.isPresent(validators) ? validators_1.Validators.composeAsync(validators.map(normalize_validator_1.normalizeValidator)) : null;
20759+
return lang_1.isPresent(validators) ? validators_1.Validators.composeAsync(validators.map(normalize_validator_1.normalizeAsyncValidator)) : null;
2074120760
}
2074220761
exports.composeAsyncValidators = composeAsyncValidators;
2074320762
function isPropertyUpdated(changes, viewModel) {
@@ -20891,14 +20910,14 @@ System.register("angular2/src/platform/dom/events/hammer_gestures", ["angular2/s
2089120910
var mc = new Hammer(element);
2089220911
mc.get('pinch').set({enable: true});
2089320912
mc.get('rotate').set({enable: true});
20894-
var handler = function(eventObj) {
20913+
var callback = function(eventObj) {
2089520914
zone.run(function() {
2089620915
handler(eventObj);
2089720916
});
2089820917
};
20899-
mc.on(eventName, handler);
20918+
mc.on(eventName, callback);
2090020919
return function() {
20901-
mc.off(eventName, handler);
20920+
mc.off(eventName, callback);
2090220921
};
2090320922
});
2090420923
};

0 commit comments

Comments
 (0)