Compare commits
11 Commits
Author | SHA1 | Date | |
---|---|---|---|
9a9a7ac7b5 | |||
423dd2898a | |||
ee2d6e572a | |||
ba8645c529 | |||
eba53fd16c | |||
c0698de2ea | |||
dc6728e7ad | |||
eb173bcd30 | |||
e39e16ae6a | |||
ff56da554f | |||
d160591453 |
12
CHANGELOG.md
12
CHANGELOG.md
@ -1,3 +1,15 @@
|
|||||||
|
<a name="2.2.4"></a>
|
||||||
|
## [2.2.4](https://github.com/angular/angular/compare/2.2.3...2.2.4) (2016-11-30)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* **common:** update DatePipe to allow closure compilation ([eba53fd](https://github.com/angular/angular/commit/eba53fd))
|
||||||
|
* **compiler:** fix performance regression caused by 5b0f9e2 ([ee2d6e5](https://github.com/angular/angular/commit/ee2d6e5)), closes [#13146](https://github.com/angular/angular/issues/13146)
|
||||||
|
* **compiler-cli:** fix paths in source maps to be relative ([eb173bc](https://github.com/angular/angular/commit/eb173bc)), closes [#13040](https://github.com/angular/angular/issues/13040)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<a name="2.2.3"></a>
|
<a name="2.2.3"></a>
|
||||||
## [2.2.3](https://github.com/angular/angular/compare/2.2.2...2.2.3) (2016-11-23)
|
## [2.2.3](https://github.com/angular/angular/compare/2.2.2...2.2.3) (2016-11-23)
|
||||||
|
|
||||||
|
@ -6,6 +6,7 @@
|
|||||||
* found in the LICENSE file at https://angular.io/license
|
* found in the LICENSE file at https://angular.io/license
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/* tslint:disable:no-console */
|
||||||
import {browser} from 'protractor';
|
import {browser} from 'protractor';
|
||||||
|
|
||||||
const assertEventsContainsName = function(events: any[], eventName: string) {
|
const assertEventsContainsName = function(events: any[], eventName: string) {
|
||||||
|
@ -59,7 +59,7 @@ const _observableStrategy = new ObservableStrategy();
|
|||||||
* {@example common/pipes/ts/async_pipe.ts region='AsyncPipePromise'}
|
* {@example common/pipes/ts/async_pipe.ts region='AsyncPipePromise'}
|
||||||
*
|
*
|
||||||
* It's also possible to use `async` with Observables. The example below binds the `time` Observable
|
* It's also possible to use `async` with Observables. The example below binds the `time` Observable
|
||||||
* to the view. The Observable continuesly updates the view with the current time.
|
* to the view. The Observable continuously updates the view with the current time.
|
||||||
*
|
*
|
||||||
* {@example common/pipes/ts/async_pipe.ts region='AsyncPipeObservable'}
|
* {@example common/pipes/ts/async_pipe.ts region='AsyncPipeObservable'}
|
||||||
*
|
*
|
||||||
|
@ -46,7 +46,7 @@ export class CodeGenerator {
|
|||||||
let root = this.options.basePath;
|
let root = this.options.basePath;
|
||||||
for (const eachRootDir of this.options.rootDirs || []) {
|
for (const eachRootDir of this.options.rootDirs || []) {
|
||||||
if (this.options.trace) {
|
if (this.options.trace) {
|
||||||
console.log(`Check if ${filePath} is under rootDirs element ${eachRootDir}`);
|
console.error(`Check if ${filePath} is under rootDirs element ${eachRootDir}`);
|
||||||
}
|
}
|
||||||
if (path.relative(eachRootDir, filePath).indexOf('.') !== 0) {
|
if (path.relative(eachRootDir, filePath).indexOf('.') !== 0) {
|
||||||
root = eachRootDir;
|
root = eachRootDir;
|
||||||
@ -161,7 +161,7 @@ export function extractProgramSymbols(
|
|||||||
|
|
||||||
const moduleMetadata = staticReflector.getModuleMetadata(absSrcPath);
|
const moduleMetadata = staticReflector.getModuleMetadata(absSrcPath);
|
||||||
if (!moduleMetadata) {
|
if (!moduleMetadata) {
|
||||||
console.log(`WARNING: no metadata found for ${absSrcPath}`);
|
console.warn(`WARNING: no metadata found for ${absSrcPath}`);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -49,7 +49,7 @@ export class PathMappedReflectorHost extends ReflectorHost {
|
|||||||
ts.resolveModuleName(m, rootedContainingFile, this.options, this.context).resolvedModule;
|
ts.resolveModuleName(m, rootedContainingFile, this.options, this.context).resolvedModule;
|
||||||
if (resolved) {
|
if (resolved) {
|
||||||
if (this.options.traceResolution) {
|
if (this.options.traceResolution) {
|
||||||
console.log('resolve', m, containingFile, '=>', resolved.resolvedFileName);
|
console.error('resolve', m, containingFile, '=>', resolved.resolvedFileName);
|
||||||
}
|
}
|
||||||
return resolved.resolvedFileName;
|
return resolved.resolvedFileName;
|
||||||
}
|
}
|
||||||
@ -67,7 +67,7 @@ export class PathMappedReflectorHost extends ReflectorHost {
|
|||||||
containingFile = this.resolveAssetUrl(containingFile, '');
|
containingFile = this.resolveAssetUrl(containingFile, '');
|
||||||
|
|
||||||
if (this.options.traceResolution) {
|
if (this.options.traceResolution) {
|
||||||
console.log(
|
console.error(
|
||||||
'getImportPath from containingFile', containingFile, 'to importedFile', importedFile);
|
'getImportPath from containingFile', containingFile, 'to importedFile', importedFile);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -152,7 +152,7 @@ export class StaticReflector implements ReflectorReader {
|
|||||||
}
|
}
|
||||||
return parameters;
|
return parameters;
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.log(`Failed on type ${JSON.stringify(type)} with error ${e}`);
|
console.error(`Failed on type ${JSON.stringify(type)} with error ${e}`);
|
||||||
throw e;
|
throw e;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,11 +1,11 @@
|
|||||||
{
|
{
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"module": "commonjs",
|
|
||||||
"target": "es5",
|
|
||||||
"lib": ["es6", "dom"],
|
|
||||||
"noImplicitAny": true,
|
|
||||||
"sourceMap": true,
|
|
||||||
"baseUrl": ".",
|
"baseUrl": ".",
|
||||||
|
"declaration": true,
|
||||||
|
"experimentalDecorators": true,
|
||||||
|
"noImplicitAny": true,
|
||||||
|
"module": "commonjs",
|
||||||
|
"outDir": "../../../dist/packages-dist/compiler-cli",
|
||||||
"paths": {
|
"paths": {
|
||||||
"@angular/core": ["../../../dist/packages-dist/core"],
|
"@angular/core": ["../../../dist/packages-dist/core"],
|
||||||
"@angular/common": ["../../../dist/packages-dist/common"],
|
"@angular/common": ["../../../dist/packages-dist/common"],
|
||||||
@ -14,11 +14,11 @@
|
|||||||
"@angular/platform-browser": ["../../../dist/packages-dist/platform-browser"],
|
"@angular/platform-browser": ["../../../dist/packages-dist/platform-browser"],
|
||||||
"@angular/tsc-wrapped": ["../../../dist/tools/@angular/tsc-wrapped"]
|
"@angular/tsc-wrapped": ["../../../dist/tools/@angular/tsc-wrapped"]
|
||||||
},
|
},
|
||||||
"experimentalDecorators": true,
|
|
||||||
"rootDir": ".",
|
"rootDir": ".",
|
||||||
"sourceRoot": ".",
|
"sourceMap": true,
|
||||||
"outDir": "../../../dist/packages-dist/compiler-cli",
|
"inlineSources": true,
|
||||||
"declaration": true,
|
"target": "es5",
|
||||||
|
"lib": ["es6", "dom"],
|
||||||
"skipLibCheck": true
|
"skipLibCheck": true
|
||||||
},
|
},
|
||||||
"exclude": ["integrationtest"],
|
"exclude": ["integrationtest"],
|
||||||
|
@ -141,7 +141,7 @@ export class CompileMetadataResolver {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
private _loadDirectiveMetadata(directiveType: any, isSync: boolean): Promise<any> {
|
private _loadDirectiveMetadata(directiveType: any, isSync: boolean): () => Promise<any> {
|
||||||
if (this._directiveCache.has(directiveType)) {
|
if (this._directiveCache.has(directiveType)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -191,7 +191,7 @@ export class CompileMetadataResolver {
|
|||||||
if (isSync) {
|
if (isSync) {
|
||||||
throw new ComponentStillLoadingError(directiveType);
|
throw new ComponentStillLoadingError(directiveType);
|
||||||
}
|
}
|
||||||
return templateMeta.asyncResult.then(createDirectiveMetadata);
|
return () => templateMeta.asyncResult.then(createDirectiveMetadata);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// directive
|
// directive
|
||||||
@ -441,8 +441,10 @@ export class CompileMetadataResolver {
|
|||||||
transitiveModule.directives.push(declaredIdentifier);
|
transitiveModule.directives.push(declaredIdentifier);
|
||||||
declaredDirectives.push(declaredIdentifier);
|
declaredDirectives.push(declaredIdentifier);
|
||||||
this._addTypeToModule(declaredType, moduleType);
|
this._addTypeToModule(declaredType, moduleType);
|
||||||
transitiveModule.directiveLoaders.push(
|
const loader = this._loadDirectiveMetadata(declaredType, isSync);
|
||||||
() => this._loadDirectiveMetadata(declaredType, isSync));
|
if (loader) {
|
||||||
|
transitiveModule.directiveLoaders.push(loader);
|
||||||
|
}
|
||||||
} else if (this._pipeResolver.isPipe(declaredType)) {
|
} else if (this._pipeResolver.isPipe(declaredType)) {
|
||||||
transitiveModule.pipesSet.add(declaredType);
|
transitiveModule.pipesSet.add(declaredType);
|
||||||
transitiveModule.pipes.push(declaredIdentifier);
|
transitiveModule.pipes.push(declaredIdentifier);
|
||||||
|
@ -6,7 +6,6 @@
|
|||||||
* found in the LICENSE file at https://angular.io/license
|
* found in the LICENSE file at https://angular.io/license
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import {APP_ID} from '../application_tokens';
|
|
||||||
import {SimpleChange, devModeEqual} from '../change_detection/change_detection';
|
import {SimpleChange, devModeEqual} from '../change_detection/change_detection';
|
||||||
import {UNINITIALIZED} from '../change_detection/change_detection_util';
|
import {UNINITIALIZED} from '../change_detection/change_detection_util';
|
||||||
import {Inject, Injectable} from '../di';
|
import {Inject, Injectable} from '../di';
|
||||||
|
@ -5,6 +5,7 @@
|
|||||||
* Use of this source code is governed by an MIT-style license that can be
|
* Use of this source code is governed by an MIT-style license that can be
|
||||||
* found in the LICENSE file at https://angular.io/license
|
* found in the LICENSE file at https://angular.io/license
|
||||||
*/
|
*/
|
||||||
|
/* tslint:disable:no-console */
|
||||||
import * as webdriver from 'selenium-webdriver';
|
import * as webdriver from 'selenium-webdriver';
|
||||||
declare var browser: any;
|
declare var browser: any;
|
||||||
declare var expect: any;
|
declare var expect: any;
|
||||||
|
@ -6,6 +6,7 @@
|
|||||||
* found in the LICENSE file at https://angular.io/license
|
* found in the LICENSE file at https://angular.io/license
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/* tslint:disable:no-console */
|
||||||
// #docregion Observable
|
// #docregion Observable
|
||||||
import {Observable} from 'rxjs/Observable';
|
import {Observable} from 'rxjs/Observable';
|
||||||
import {Subscriber} from 'rxjs/Subscriber';
|
import {Subscriber} from 'rxjs/Subscriber';
|
||||||
|
@ -6,6 +6,7 @@
|
|||||||
* found in the LICENSE file at https://angular.io/license
|
* found in the LICENSE file at https://angular.io/license
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/* tslint:disable:no-console */
|
||||||
// #docregion Observable
|
// #docregion Observable
|
||||||
import 'rxjs/add/operator/map';
|
import 'rxjs/add/operator/map';
|
||||||
|
|
||||||
|
@ -6,6 +6,7 @@
|
|||||||
* found in the LICENSE file at https://angular.io/license
|
* found in the LICENSE file at https://angular.io/license
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/* tslint:disable:no-console */
|
||||||
// #docregion Observable
|
// #docregion Observable
|
||||||
import {Observable} from 'rxjs/Observable';
|
import {Observable} from 'rxjs/Observable';
|
||||||
import {Subscriber} from 'rxjs/Subscriber';
|
import {Subscriber} from 'rxjs/Subscriber';
|
||||||
|
@ -6,6 +6,7 @@
|
|||||||
* found in the LICENSE file at https://angular.io/license
|
* found in the LICENSE file at https://angular.io/license
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/* tslint:disable:no-console */
|
||||||
// #docregion Component
|
// #docregion Component
|
||||||
import {Component} from '@angular/core';
|
import {Component} from '@angular/core';
|
||||||
import {FormArray, FormControl, FormGroup} from '@angular/forms';
|
import {FormArray, FormControl, FormGroup} from '@angular/forms';
|
||||||
|
@ -6,6 +6,7 @@
|
|||||||
* found in the LICENSE file at https://angular.io/license
|
* found in the LICENSE file at https://angular.io/license
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/* tslint:disable:no-console */
|
||||||
// #docregion Component
|
// #docregion Component
|
||||||
import {Component} from '@angular/core';
|
import {Component} from '@angular/core';
|
||||||
import {FormControl, FormGroup, Validators} from '@angular/forms';
|
import {FormControl, FormGroup, Validators} from '@angular/forms';
|
||||||
|
@ -6,6 +6,7 @@
|
|||||||
* found in the LICENSE file at https://angular.io/license
|
* found in the LICENSE file at https://angular.io/license
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/* tslint:disable:no-console */
|
||||||
// #docregion Component
|
// #docregion Component
|
||||||
import {Component} from '@angular/core';
|
import {Component} from '@angular/core';
|
||||||
import {NgForm} from '@angular/forms';
|
import {NgForm} from '@angular/forms';
|
||||||
|
@ -6,6 +6,7 @@
|
|||||||
* found in the LICENSE file at https://angular.io/license
|
* found in the LICENSE file at https://angular.io/license
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/* tslint:disable:no-console */
|
||||||
// #docregion Component
|
// #docregion Component
|
||||||
import {Component} from '@angular/core';
|
import {Component} from '@angular/core';
|
||||||
import {NgForm} from '@angular/forms';
|
import {NgForm} from '@angular/forms';
|
||||||
|
@ -6,6 +6,7 @@
|
|||||||
* found in the LICENSE file at https://angular.io/license
|
* found in the LICENSE file at https://angular.io/license
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/* tslint:disable:no-console */
|
||||||
// #docregion Component
|
// #docregion Component
|
||||||
import {Component} from '@angular/core';
|
import {Component} from '@angular/core';
|
||||||
import {FormControl, FormGroup, Validators} from '@angular/forms';
|
import {FormControl, FormGroup, Validators} from '@angular/forms';
|
||||||
|
@ -44,6 +44,7 @@ const DATE_FORMATS_SPLIT =
|
|||||||
/((?:[^yMLdHhmsazZEwGjJ']+)|(?:'(?:[^']|'')*')|(?:E+|y+|M+|L+|d+|H+|h+|J+|j+|m+|s+|a|z|Z|G+|w+))(.*)/;
|
/((?:[^yMLdHhmsazZEwGjJ']+)|(?:'(?:[^']|'')*')|(?:E+|y+|M+|L+|d+|H+|h+|J+|j+|m+|s+|a|z|Z|G+|w+))(.*)/;
|
||||||
|
|
||||||
const PATTERN_ALIASES: {[format: string]: DateFormatterFn} = {
|
const PATTERN_ALIASES: {[format: string]: DateFormatterFn} = {
|
||||||
|
// Keys are quoted so they do not get renamed during closure compilation.
|
||||||
'yMMMdjms': datePartGetterFactory(combine([
|
'yMMMdjms': datePartGetterFactory(combine([
|
||||||
digitCondition('year', 1),
|
digitCondition('year', 1),
|
||||||
nameCondition('month', 3),
|
nameCondition('month', 3),
|
||||||
@ -72,48 +73,50 @@ const PATTERN_ALIASES: {[format: string]: DateFormatterFn} = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const DATE_FORMATS: {[format: string]: DateFormatterFn} = {
|
const DATE_FORMATS: {[format: string]: DateFormatterFn} = {
|
||||||
yyyy: datePartGetterFactory(digitCondition('year', 4)),
|
// Keys are quoted so they do not get renamed.
|
||||||
yy: datePartGetterFactory(digitCondition('year', 2)),
|
'yyyy': datePartGetterFactory(digitCondition('year', 4)),
|
||||||
y: datePartGetterFactory(digitCondition('year', 1)),
|
'yy': datePartGetterFactory(digitCondition('year', 2)),
|
||||||
MMMM: datePartGetterFactory(nameCondition('month', 4)),
|
'y': datePartGetterFactory(digitCondition('year', 1)),
|
||||||
MMM: datePartGetterFactory(nameCondition('month', 3)),
|
'MMMM': datePartGetterFactory(nameCondition('month', 4)),
|
||||||
MM: datePartGetterFactory(digitCondition('month', 2)),
|
'MMM': datePartGetterFactory(nameCondition('month', 3)),
|
||||||
M: datePartGetterFactory(digitCondition('month', 1)),
|
'MM': datePartGetterFactory(digitCondition('month', 2)),
|
||||||
LLLL: datePartGetterFactory(nameCondition('month', 4)),
|
'M': datePartGetterFactory(digitCondition('month', 1)),
|
||||||
L: datePartGetterFactory(nameCondition('month', 1)),
|
'LLLL': datePartGetterFactory(nameCondition('month', 4)),
|
||||||
dd: datePartGetterFactory(digitCondition('day', 2)),
|
'L': datePartGetterFactory(nameCondition('month', 1)),
|
||||||
d: datePartGetterFactory(digitCondition('day', 1)),
|
'dd': datePartGetterFactory(digitCondition('day', 2)),
|
||||||
HH: digitModifier(
|
'd': datePartGetterFactory(digitCondition('day', 1)),
|
||||||
|
'HH': digitModifier(
|
||||||
hourExtractor(datePartGetterFactory(hour12Modify(digitCondition('hour', 2), false)))),
|
hourExtractor(datePartGetterFactory(hour12Modify(digitCondition('hour', 2), false)))),
|
||||||
H: hourExtractor(datePartGetterFactory(hour12Modify(digitCondition('hour', 1), false))),
|
'H': hourExtractor(datePartGetterFactory(hour12Modify(digitCondition('hour', 1), false))),
|
||||||
hh: digitModifier(
|
'hh': digitModifier(
|
||||||
hourExtractor(datePartGetterFactory(hour12Modify(digitCondition('hour', 2), true)))),
|
hourExtractor(datePartGetterFactory(hour12Modify(digitCondition('hour', 2), true)))),
|
||||||
h: hourExtractor(datePartGetterFactory(hour12Modify(digitCondition('hour', 1), true))),
|
'h': hourExtractor(datePartGetterFactory(hour12Modify(digitCondition('hour', 1), true))),
|
||||||
jj: datePartGetterFactory(digitCondition('hour', 2)),
|
'jj': datePartGetterFactory(digitCondition('hour', 2)),
|
||||||
j: datePartGetterFactory(digitCondition('hour', 1)),
|
'j': datePartGetterFactory(digitCondition('hour', 1)),
|
||||||
mm: digitModifier(datePartGetterFactory(digitCondition('minute', 2))),
|
'mm': digitModifier(datePartGetterFactory(digitCondition('minute', 2))),
|
||||||
m: datePartGetterFactory(digitCondition('minute', 1)),
|
'm': datePartGetterFactory(digitCondition('minute', 1)),
|
||||||
ss: digitModifier(datePartGetterFactory(digitCondition('second', 2))),
|
'ss': digitModifier(datePartGetterFactory(digitCondition('second', 2))),
|
||||||
s: datePartGetterFactory(digitCondition('second', 1)),
|
's': datePartGetterFactory(digitCondition('second', 1)),
|
||||||
// while ISO 8601 requires fractions to be prefixed with `.` or `,`
|
// while ISO 8601 requires fractions to be prefixed with `.` or `,`
|
||||||
// we can be just safely rely on using `sss` since we currently don't support single or two digit
|
// we can be just safely rely on using `sss` since we currently don't support single or two digit
|
||||||
// fractions
|
// fractions
|
||||||
sss: datePartGetterFactory(digitCondition('second', 3)),
|
'sss': datePartGetterFactory(digitCondition('second', 3)),
|
||||||
EEEE: datePartGetterFactory(nameCondition('weekday', 4)),
|
'EEEE': datePartGetterFactory(nameCondition('weekday', 4)),
|
||||||
EEE: datePartGetterFactory(nameCondition('weekday', 3)),
|
'EEE': datePartGetterFactory(nameCondition('weekday', 3)),
|
||||||
EE: datePartGetterFactory(nameCondition('weekday', 2)),
|
'EE': datePartGetterFactory(nameCondition('weekday', 2)),
|
||||||
E: datePartGetterFactory(nameCondition('weekday', 1)),
|
'E': datePartGetterFactory(nameCondition('weekday', 1)),
|
||||||
a: hourClockExtractor(datePartGetterFactory(hour12Modify(digitCondition('hour', 1), true))),
|
'a': hourClockExtractor(datePartGetterFactory(hour12Modify(digitCondition('hour', 1), true))),
|
||||||
Z: timeZoneGetter('short'),
|
'Z': timeZoneGetter('short'),
|
||||||
z: timeZoneGetter('long'),
|
'z': timeZoneGetter('long'),
|
||||||
ww: datePartGetterFactory({}), // Week of year, padded (00-53). Week 01 is the week with the
|
'ww': datePartGetterFactory({}), // Week of year, padded (00-53). Week 01 is the week with the
|
||||||
// first Thursday of the year. not support ?
|
// first Thursday of the year. not support ?
|
||||||
w: datePartGetterFactory({}), // Week of year (0-53). Week 1 is the week with the first Thursday
|
'w':
|
||||||
|
datePartGetterFactory({}), // Week of year (0-53). Week 1 is the week with the first Thursday
|
||||||
// of the year not support ?
|
// of the year not support ?
|
||||||
G: datePartGetterFactory(nameCondition('era', 1)),
|
'G': datePartGetterFactory(nameCondition('era', 1)),
|
||||||
GG: datePartGetterFactory(nameCondition('era', 2)),
|
'GG': datePartGetterFactory(nameCondition('era', 2)),
|
||||||
GGG: datePartGetterFactory(nameCondition('era', 3)),
|
'GGG': datePartGetterFactory(nameCondition('era', 3)),
|
||||||
GGGG: datePartGetterFactory(nameCondition('era', 4))
|
'GGGG': datePartGetterFactory(nameCondition('era', 4))
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -129,6 +129,7 @@ export function isJsObject(o: any): boolean {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export function print(obj: Error | Object) {
|
export function print(obj: Error | Object) {
|
||||||
|
// tslint:disable-next-line:no-console
|
||||||
console.log(obj);
|
console.log(obj);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -59,7 +59,7 @@ export class XHRConnection implements Connection {
|
|||||||
// responseText is the old-school way of retrieving response (supported by IE8 & 9)
|
// responseText is the old-school way of retrieving response (supported by IE8 & 9)
|
||||||
// response/responseType properties were introduced in ResourceLoader Level2 spec
|
// response/responseType properties were introduced in ResourceLoader Level2 spec
|
||||||
// (supported by IE10)
|
// (supported by IE10)
|
||||||
body = _xhr.response == null ? _xhr.responseText : _xhr.response;
|
body = (typeof _xhr.response === 'undefined') ? _xhr.responseText : _xhr.response;
|
||||||
|
|
||||||
// Implicitly strip a potential XSSI prefix.
|
// Implicitly strip a potential XSSI prefix.
|
||||||
if (typeof body === 'string') {
|
if (typeof body === 'string') {
|
||||||
|
@ -85,6 +85,7 @@ export class BrowserDomAdapter extends GenericBrowserDomAdapter {
|
|||||||
|
|
||||||
log(error: string): void {
|
log(error: string): void {
|
||||||
if (window.console) {
|
if (window.console) {
|
||||||
|
// tslint:disable-next-line:no-console
|
||||||
window.console.log && window.console.log(error);
|
window.console.log && window.console.log(error);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -36,6 +36,7 @@ export class AngularProfiler {
|
|||||||
|
|
||||||
constructor(ref: ComponentRef<any>) { this.appRef = ref.injector.get(ApplicationRef); }
|
constructor(ref: ComponentRef<any>) { this.appRef = ref.injector.get(ApplicationRef); }
|
||||||
|
|
||||||
|
// tslint:disable:no-console
|
||||||
/**
|
/**
|
||||||
* Exercises change detection in a loop and then prints the average amount of
|
* Exercises change detection in a loop and then prints the average amount of
|
||||||
* time in milliseconds how long a single round of change detection takes for
|
* time in milliseconds how long a single round of change detection takes for
|
||||||
|
@ -63,6 +63,7 @@ export class Parse5DomAdapter extends DomAdapter {
|
|||||||
|
|
||||||
logError(error: string) { console.error(error); }
|
logError(error: string) { console.error(error); }
|
||||||
|
|
||||||
|
// tslint:disable-next-line:no-console
|
||||||
log(error: string) { console.log(error); }
|
log(error: string) { console.log(error); }
|
||||||
|
|
||||||
logGroup(error: string) { console.error(error); }
|
logGroup(error: string) { console.error(error); }
|
||||||
|
@ -22,10 +22,12 @@ export class WorkerDomAdapter extends DomAdapter {
|
|||||||
if (console.error) {
|
if (console.error) {
|
||||||
console.error(error);
|
console.error(error);
|
||||||
} else {
|
} else {
|
||||||
|
// tslint:disable-next-line:no-console
|
||||||
console.log(error);
|
console.log(error);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// tslint:disable-next-line:no-console
|
||||||
log(error: any /** TODO #9100 */) { console.log(error); }
|
log(error: any /** TODO #9100 */) { console.log(error); }
|
||||||
|
|
||||||
logGroup(error: any /** TODO #9100 */) {
|
logGroup(error: any /** TODO #9100 */) {
|
||||||
@ -33,6 +35,7 @@ export class WorkerDomAdapter extends DomAdapter {
|
|||||||
console.group(error);
|
console.group(error);
|
||||||
this.logError(error);
|
this.logError(error);
|
||||||
} else {
|
} else {
|
||||||
|
// tslint:disable-next-line:no-console
|
||||||
console.log(error);
|
console.log(error);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -15,7 +15,12 @@ export function stringify(obj: any): string {
|
|||||||
|
|
||||||
export function onError(e: any) {
|
export function onError(e: any) {
|
||||||
// TODO: (misko): We seem to not have a stack trace here!
|
// TODO: (misko): We seem to not have a stack trace here!
|
||||||
console.log(e, e.stack);
|
if (console.error) {
|
||||||
|
console.error(e, e.stack);
|
||||||
|
} else {
|
||||||
|
// tslint:disable-next-line:no-console
|
||||||
|
console.log(e, e.stack);
|
||||||
|
}
|
||||||
throw e;
|
throw e;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -41,7 +41,7 @@ export function main() {
|
|||||||
|
|
||||||
it('should throw an uncaught error', fakeAsync(() => {
|
it('should throw an uncaught error', fakeAsync(() => {
|
||||||
const resolveSpy = jasmine.createSpy('resolveSpy');
|
const resolveSpy = jasmine.createSpy('resolveSpy');
|
||||||
spyOn(console, 'log');
|
spyOn(console, 'error');
|
||||||
|
|
||||||
expect(() => {
|
expect(() => {
|
||||||
adapter.bootstrap(html('<ng2></ng2>'), ['ng1']).ready(resolveSpy);
|
adapter.bootstrap(html('<ng2></ng2>'), ['ng1']).ready(resolveSpy);
|
||||||
@ -50,14 +50,14 @@ export function main() {
|
|||||||
expect(resolveSpy).not.toHaveBeenCalled();
|
expect(resolveSpy).not.toHaveBeenCalled();
|
||||||
}));
|
}));
|
||||||
|
|
||||||
it('should properly log to the console and re-throw', fakeAsync(() => {
|
it('should output an error message to the console and re-throw', fakeAsync(() => {
|
||||||
spyOn(console, 'log');
|
spyOn(console, 'error');
|
||||||
expect(() => {
|
expect(() => {
|
||||||
adapter.bootstrap(html('<ng2></ng2>'), ['ng1']);
|
adapter.bootstrap(html('<ng2></ng2>'), ['ng1']);
|
||||||
flushMicrotasks();
|
flushMicrotasks();
|
||||||
}).toThrowError();
|
}).toThrowError();
|
||||||
expect(console.log).toHaveBeenCalled();
|
expect(console.error).toHaveBeenCalled();
|
||||||
expect(console.log).toHaveBeenCalledWith(jasmine.any(Error), jasmine.any(String));
|
expect(console.error).toHaveBeenCalledWith(jasmine.any(Error), jasmine.any(String));
|
||||||
}));
|
}));
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -24,7 +24,6 @@ describe('ng2 largetable benchmark', function() {
|
|||||||
|
|
||||||
['interpolation', 'interpolationAttr', 'interpolationFn'].forEach(function(benchmarkType) {
|
['interpolation', 'interpolationAttr', 'interpolationFn'].forEach(function(benchmarkType) {
|
||||||
it('should log the ng stats with: ' + benchmarkType, function(done) {
|
it('should log the ng stats with: ' + benchmarkType, function(done) {
|
||||||
console.log('executing for type', benchmarkType);
|
|
||||||
runClickBenchmark({
|
runClickBenchmark({
|
||||||
url: URL,
|
url: URL,
|
||||||
buttons: ['#ng2DestroyDom', '#ng2CreateDom'],
|
buttons: ['#ng2DestroyDom', '#ng2CreateDom'],
|
||||||
|
@ -6,6 +6,7 @@
|
|||||||
* found in the LICENSE file at https://angular.io/license
|
* found in the LICENSE file at https://angular.io/license
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/* tslint:disable:no-console */
|
||||||
urlParamsToForm();
|
urlParamsToForm();
|
||||||
|
|
||||||
export function getIntParameter(name: string) {
|
export function getIntParameter(name: string) {
|
||||||
|
@ -6,6 +6,7 @@
|
|||||||
* found in the LICENSE file at https://angular.io/license
|
* found in the LICENSE file at https://angular.io/license
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/* tslint:disable:no-console */
|
||||||
import {browser} from 'protractor';
|
import {browser} from 'protractor';
|
||||||
|
|
||||||
const yargs = require('yargs');
|
const yargs = require('yargs');
|
||||||
|
@ -67,7 +67,7 @@ describe('WebWorkers Animations', function() {
|
|||||||
browser.wait(protractor.until.elementLocated(by.css(selector + ' .box')), 5000)
|
browser.wait(protractor.until.elementLocated(by.css(selector + ' .box')), 5000)
|
||||||
.then(() => {}, () => {
|
.then(() => {}, () => {
|
||||||
// jasmine will timeout if this gets called too many times
|
// jasmine will timeout if this gets called too many times
|
||||||
console.log('>> unexpected timeout -> browser.refresh()');
|
console.error('>> unexpected timeout -> browser.refresh()');
|
||||||
browser.refresh();
|
browser.refresh();
|
||||||
waitForBootstrap();
|
waitForBootstrap();
|
||||||
});
|
});
|
||||||
|
@ -67,7 +67,7 @@ describe('WebWorkers Input', function() {
|
|||||||
},
|
},
|
||||||
() => {
|
() => {
|
||||||
// jasmine will timeout if this gets called too many times
|
// jasmine will timeout if this gets called too many times
|
||||||
console.log('>> unexpected timeout -> browser.refresh()');
|
console.error('>> unexpected timeout -> browser.refresh()');
|
||||||
browser.refresh();
|
browser.refresh();
|
||||||
waitForBootstrap();
|
waitForBootstrap();
|
||||||
});
|
});
|
||||||
|
@ -6,6 +6,7 @@
|
|||||||
* found in the LICENSE file at https://angular.io/license
|
* found in the LICENSE file at https://angular.io/license
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/* tslint:disable:no-console */
|
||||||
import {Component, Host, NgModule} from '@angular/core';
|
import {Component, Host, NgModule} from '@angular/core';
|
||||||
import {AbstractControl, FormBuilder, FormGroup, FormGroupDirective, ReactiveFormsModule, Validators} from '@angular/forms';
|
import {AbstractControl, FormBuilder, FormGroup, FormGroupDirective, ReactiveFormsModule, Validators} from '@angular/forms';
|
||||||
import {BrowserModule} from '@angular/platform-browser';
|
import {BrowserModule} from '@angular/platform-browser';
|
||||||
|
@ -6,6 +6,7 @@
|
|||||||
* found in the LICENSE file at https://angular.io/license
|
* found in the LICENSE file at https://angular.io/license
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/* tslint:disable:no-console */
|
||||||
|
|
||||||
import {Component, Directive, Host, NgModule} from '@angular/core';
|
import {Component, Directive, Host, NgModule} from '@angular/core';
|
||||||
import {FormControl, FormGroup, FormsModule, NG_VALIDATORS, NgForm} from '@angular/forms';
|
import {FormControl, FormGroup, FormsModule, NG_VALIDATORS, NgForm} from '@angular/forms';
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "angular-srcs",
|
"name": "angular-srcs",
|
||||||
"version": "2.2.3",
|
"version": "2.2.4",
|
||||||
"private": true,
|
"private": true,
|
||||||
"branchPattern": "2.0.*",
|
"branchPattern": "2.0.*",
|
||||||
"description": "Angular 2 - a web framework for modern web apps",
|
"description": "Angular 2 - a web framework for modern web apps",
|
||||||
|
@ -28,6 +28,7 @@ export interface CompilerInterface {
|
|||||||
const DEBUG = false;
|
const DEBUG = false;
|
||||||
|
|
||||||
function debug(msg: string, ...o: any[]) {
|
function debug(msg: string, ...o: any[]) {
|
||||||
|
// tslint:disable-next-line:no-console
|
||||||
if (DEBUG) console.log(msg, ...o);
|
if (DEBUG) console.log(msg, ...o);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -6,6 +6,7 @@
|
|||||||
* found in the LICENSE file at https://angular.io/license
|
* found in the LICENSE file at https://angular.io/license
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/* tslint:disable:no-console */
|
||||||
import {spawn} from 'child_process';
|
import {spawn} from 'child_process';
|
||||||
import {existsSync, mkdirSync, writeFileSync} from 'fs';
|
import {existsSync, mkdirSync, writeFileSync} from 'fs';
|
||||||
|
|
||||||
|
@ -6,6 +6,7 @@
|
|||||||
* found in the LICENSE file at https://angular.io/license
|
* found in the LICENSE file at https://angular.io/license
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/* tslint:disable:no-console */
|
||||||
import {spawn} from 'child_process';
|
import {spawn} from 'child_process';
|
||||||
import {platform} from 'os';
|
import {platform} from 'os';
|
||||||
import {normalize} from 'path';
|
import {normalize} from 'path';
|
||||||
|
@ -5,6 +5,7 @@
|
|||||||
],
|
],
|
||||||
"rules": {
|
"rules": {
|
||||||
"file-header": [true, "Copyright Google Inc\\."],
|
"file-header": [true, "Copyright Google Inc\\."],
|
||||||
|
"no-console": [true, "log"],
|
||||||
"no-duplicate-imports": true,
|
"no-duplicate-imports": true,
|
||||||
"no-duplicate-variable": true,
|
"no-duplicate-variable": true,
|
||||||
"no-jasmine-focus": true,
|
"no-jasmine-focus": true,
|
||||||
|
Reference in New Issue
Block a user