parent
929334b0bf
commit
b61dafaeac
|
@ -23,7 +23,7 @@ export function supportsAnimationEventCreation() {
|
||||||
try {
|
try {
|
||||||
makeAnimationEvent('end', 'test', 0);
|
makeAnimationEvent('end', 'test', 0);
|
||||||
supported = true;
|
supported = true;
|
||||||
} catch (e) {
|
} catch {
|
||||||
}
|
}
|
||||||
return supported;
|
return supported;
|
||||||
}
|
}
|
||||||
|
|
|
@ -149,7 +149,7 @@ export class NgForOf<T> implements DoCheck {
|
||||||
if (!this._differ && value) {
|
if (!this._differ && value) {
|
||||||
try {
|
try {
|
||||||
this._differ = this._differs.find(value).create(this.ngForTrackBy);
|
this._differ = this._differs.find(value).create(this.ngForTrackBy);
|
||||||
} catch (e) {
|
} catch {
|
||||||
throw new Error(
|
throw new Error(
|
||||||
`Cannot find a differ supporting object '${value}' of type '${getTypeNameForDebugging(value)}'. NgFor only supports binding to Iterables such as Arrays.`);
|
`Cannot find a differ supporting object '${value}' of type '${getTypeNameForDebugging(value)}'. NgFor only supports binding to Iterables such as Arrays.`);
|
||||||
}
|
}
|
||||||
|
|
|
@ -150,7 +150,7 @@ export class BrowserViewportScroller implements ViewportScroller {
|
||||||
private supportScrollRestoration(): boolean {
|
private supportScrollRestoration(): boolean {
|
||||||
try {
|
try {
|
||||||
return !!this.window && !!this.window.scrollTo;
|
return !!this.window && !!this.window.scrollTo;
|
||||||
} catch (e) {
|
} catch {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -246,7 +246,7 @@ export class TsCompilerAotCompilerTypeCheckHostAdapter implements ts.CompilerHos
|
||||||
if (packageTypings === originalImportedFile) {
|
if (packageTypings === originalImportedFile) {
|
||||||
moduleName = importedFilePackageName;
|
moduleName = importedFilePackageName;
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch {
|
||||||
// the above require() will throw if there is no package.json file
|
// the above require() will throw if there is no package.json file
|
||||||
// and this is safe to ignore and correct to keep the longer
|
// and this is safe to ignore and correct to keep the longer
|
||||||
// moduleName in this case
|
// moduleName in this case
|
||||||
|
@ -582,7 +582,7 @@ export class TsCompilerAotCompilerTypeCheckHostAdapter implements ts.CompilerHos
|
||||||
result = false;
|
result = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch {
|
||||||
// If we encounter any errors assume we this isn't a bundle index.
|
// If we encounter any errors assume we this isn't a bundle index.
|
||||||
result = false;
|
result = false;
|
||||||
}
|
}
|
||||||
|
|
|
@ -334,7 +334,7 @@ class _Tokenizer {
|
||||||
try {
|
try {
|
||||||
const charCode = parseInt(strNum, isHex ? 16 : 10);
|
const charCode = parseInt(strNum, isHex ? 16 : 10);
|
||||||
return String.fromCharCode(charCode);
|
return String.fromCharCode(charCode);
|
||||||
} catch (e) {
|
} catch {
|
||||||
const entity = this._input.substring(start.offset + 1, this._index - 1);
|
const entity = this._input.substring(start.offset + 1, this._index - 1);
|
||||||
throw this._createError(_unknownEntityErrorMsg(entity), this._getSpan(start));
|
throw this._createError(_unknownEntityErrorMsg(entity), this._getSpan(start));
|
||||||
}
|
}
|
||||||
|
|
|
@ -74,7 +74,7 @@ export class InertBodyHelper {
|
||||||
html = '<body><remove></remove>' + html + '</body>';
|
html = '<body><remove></remove>' + html + '</body>';
|
||||||
try {
|
try {
|
||||||
html = encodeURI(html);
|
html = encodeURI(html);
|
||||||
} catch (e) {
|
} catch {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
const xhr = new XMLHttpRequest();
|
const xhr = new XMLHttpRequest();
|
||||||
|
@ -103,7 +103,7 @@ export class InertBodyHelper {
|
||||||
.body as HTMLBodyElement;
|
.body as HTMLBodyElement;
|
||||||
body.removeChild(body.firstChild !);
|
body.removeChild(body.firstChild !);
|
||||||
return body;
|
return body;
|
||||||
} catch (e) {
|
} catch {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -169,7 +169,7 @@ export class InertBodyHelper {
|
||||||
function isDOMParserAvailable() {
|
function isDOMParserAvailable() {
|
||||||
try {
|
try {
|
||||||
return !!(window as any).DOMParser;
|
return !!(window as any).DOMParser;
|
||||||
} catch (e) {
|
} catch {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -169,7 +169,7 @@ export class SpyObject {
|
||||||
let m: any = null;
|
let m: any = null;
|
||||||
try {
|
try {
|
||||||
m = type.prototype[prop];
|
m = type.prototype[prop];
|
||||||
} catch (e) {
|
} catch {
|
||||||
// As we are creating spys for abstract classes,
|
// As we are creating spys for abstract classes,
|
||||||
// these classes might have getters that throw when they are accessed.
|
// these classes might have getters that throw when they are accessed.
|
||||||
// As we are only auto creating spys for methods, this
|
// As we are only auto creating spys for methods, this
|
||||||
|
|
|
@ -64,7 +64,7 @@ function addScript(options: Schema) {
|
||||||
scripts.push({input: script});
|
scripts.push({input: script});
|
||||||
host.overwrite('angular.json', JSON.stringify(json, null, 2));
|
host.overwrite('angular.json', JSON.stringify(json, null, 2));
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch {
|
||||||
context.logger.log(
|
context.logger.log(
|
||||||
'warn', 'Failed to add the polyfill document-register-element.js to scripts');
|
'warn', 'Failed to add the polyfill document-register-element.js to scripts');
|
||||||
}
|
}
|
||||||
|
|
|
@ -327,7 +327,7 @@ class MockBrowserXHR extends BrowserXhr {
|
||||||
let newBlob: Blob;
|
let newBlob: Blob;
|
||||||
try {
|
try {
|
||||||
newBlob = new Blob(data || [], datatype ? {type: datatype} : {});
|
newBlob = new Blob(data || [], datatype ? {type: datatype} : {});
|
||||||
} catch (e) {
|
} catch {
|
||||||
const BlobBuilder = (<any>global).BlobBuilder || (<any>global).WebKitBlobBuilder ||
|
const BlobBuilder = (<any>global).BlobBuilder || (<any>global).WebKitBlobBuilder ||
|
||||||
(<any>global).MozBlobBuilder || (<any>global).MSBlobBuilder;
|
(<any>global).MozBlobBuilder || (<any>global).MSBlobBuilder;
|
||||||
const builder = new BlobBuilder();
|
const builder = new BlobBuilder();
|
||||||
|
|
|
@ -295,7 +295,7 @@ export class BrowserDomAdapter extends GenericBrowserDomAdapter {
|
||||||
getBoundingClientRect(el: Element): any {
|
getBoundingClientRect(el: Element): any {
|
||||||
try {
|
try {
|
||||||
return el.getBoundingClientRect();
|
return el.getBoundingClientRect();
|
||||||
} catch (e) {
|
} catch {
|
||||||
return {top: 0, bottom: 0, left: 0, right: 0, width: 0, height: 0};
|
return {top: 0, bottom: 0, left: 0, right: 0, width: 0, height: 0};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -48,7 +48,7 @@ export abstract class GenericBrowserDomAdapter extends DomAdapter {
|
||||||
this._transitionEnd = transEndEventNames[key];
|
this._transitionEnd = transEndEventNames[key];
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} catch (e) {
|
} catch {
|
||||||
this._animationPrefix = null;
|
this._animationPrefix = null;
|
||||||
this._transitionEnd = null;
|
this._transitionEnd = null;
|
||||||
}
|
}
|
||||||
|
|
|
@ -133,7 +133,7 @@ function initWebWorkerRenderPlatform(injector: Injector): () => void {
|
||||||
let scriptUri: string;
|
let scriptUri: string;
|
||||||
try {
|
try {
|
||||||
scriptUri = injector.get(WORKER_SCRIPT);
|
scriptUri = injector.get(WORKER_SCRIPT);
|
||||||
} catch (e) {
|
} catch {
|
||||||
throw new Error(
|
throw new Error(
|
||||||
'You must provide your WebWorker\'s initialization script with the WORKER_SCRIPT token');
|
'You must provide your WebWorker\'s initialization script with the WORKER_SCRIPT token');
|
||||||
}
|
}
|
||||||
|
|
|
@ -212,7 +212,7 @@ export abstract class AssetGroup {
|
||||||
// Check the metadata table. If a timestamp is there, use it.
|
// Check the metadata table. If a timestamp is there, use it.
|
||||||
const metaTable = await this.metadata;
|
const metaTable = await this.metadata;
|
||||||
ts = (await metaTable.read<UrlMetadata>(req.url)).ts;
|
ts = (await metaTable.read<UrlMetadata>(req.url)).ts;
|
||||||
} catch (e) {
|
} catch {
|
||||||
// Otherwise, look for a Date header.
|
// Otherwise, look for a Date header.
|
||||||
const date = res.headers.get('Date');
|
const date = res.headers.get('Date');
|
||||||
if (date === null) {
|
if (date === null) {
|
||||||
|
@ -224,7 +224,7 @@ export abstract class AssetGroup {
|
||||||
}
|
}
|
||||||
const age = this.adapter.time - ts;
|
const age = this.adapter.time - ts;
|
||||||
return age < 0 || age > maxAge;
|
return age < 0 || age > maxAge;
|
||||||
} catch (e) {
|
} catch {
|
||||||
// Assume stale.
|
// Assume stale.
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -235,7 +235,7 @@ export abstract class AssetGroup {
|
||||||
// The request needs to be revalidated if the current time is later than the expiration
|
// The request needs to be revalidated if the current time is later than the expiration
|
||||||
// time, if it parses correctly.
|
// time, if it parses correctly.
|
||||||
return this.adapter.time > Date.parse(expiresStr);
|
return this.adapter.time > Date.parse(expiresStr);
|
||||||
} catch (e) {
|
} catch {
|
||||||
// The expiration date failed to parse, so revalidate as a precaution.
|
// The expiration date failed to parse, so revalidate as a precaution.
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -263,7 +263,7 @@ export abstract class AssetGroup {
|
||||||
let metadata: UrlMetadata|undefined = undefined;
|
let metadata: UrlMetadata|undefined = undefined;
|
||||||
try {
|
try {
|
||||||
metadata = await metaTable.read<UrlMetadata>(url);
|
metadata = await metaTable.read<UrlMetadata>(url);
|
||||||
} catch (e) {
|
} catch {
|
||||||
// Do nothing, not found. This shouldn't happen, but it can be handled.
|
// Do nothing, not found. This shouldn't happen, but it can be handled.
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -487,7 +487,7 @@ export abstract class AssetGroup {
|
||||||
protected async safeFetch(req: Request): Promise<Response> {
|
protected async safeFetch(req: Request): Promise<Response> {
|
||||||
try {
|
try {
|
||||||
return await this.scope.fetch(req);
|
return await this.scope.fetch(req);
|
||||||
} catch (err) {
|
} catch {
|
||||||
return this.adapter.newResponse('', {
|
return this.adapter.newResponse('', {
|
||||||
status: 504,
|
status: 504,
|
||||||
statusText: 'Gateway Timeout',
|
statusText: 'Gateway Timeout',
|
||||||
|
|
|
@ -258,7 +258,7 @@ export class DataGroup {
|
||||||
const table = await this.lruTable;
|
const table = await this.lruTable;
|
||||||
try {
|
try {
|
||||||
this._lru = new LruList(await table.read<LruState>('lru'));
|
this._lru = new LruList(await table.read<LruState>('lru'));
|
||||||
} catch (e) {
|
} catch {
|
||||||
this._lru = new LruList();
|
this._lru = new LruList();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -371,7 +371,7 @@ export class DataGroup {
|
||||||
// If that fetch errors, treat it as a timed out request.
|
// If that fetch errors, treat it as a timed out request.
|
||||||
try {
|
try {
|
||||||
res = await timeoutFetch;
|
res = await timeoutFetch;
|
||||||
} catch (e) {
|
} catch {
|
||||||
res = undefined;
|
res = undefined;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -407,7 +407,7 @@ export class DataGroup {
|
||||||
const safeNetworkFetch = (async() => {
|
const safeNetworkFetch = (async() => {
|
||||||
try {
|
try {
|
||||||
return await networkFetch;
|
return await networkFetch;
|
||||||
} catch (err) {
|
} catch {
|
||||||
return this.adapter.newResponse(null, {
|
return this.adapter.newResponse(null, {
|
||||||
status: 504,
|
status: 504,
|
||||||
statusText: 'Gateway Timeout',
|
statusText: 'Gateway Timeout',
|
||||||
|
@ -417,7 +417,7 @@ export class DataGroup {
|
||||||
const networkFetchUndefinedError = (async() => {
|
const networkFetchUndefinedError = (async() => {
|
||||||
try {
|
try {
|
||||||
return await networkFetch;
|
return await networkFetch;
|
||||||
} catch (err) {
|
} catch {
|
||||||
return undefined;
|
return undefined;
|
||||||
}
|
}
|
||||||
})();
|
})();
|
||||||
|
@ -436,7 +436,7 @@ export class DataGroup {
|
||||||
private async safeCacheResponse(req: Request, res: Promise<Response>): Promise<void> {
|
private async safeCacheResponse(req: Request, res: Promise<Response>): Promise<void> {
|
||||||
try {
|
try {
|
||||||
await this.cacheResponse(req, await res, await this.lru());
|
await this.cacheResponse(req, await res, await this.lru());
|
||||||
} catch (e) {
|
} catch {
|
||||||
// TODO: handle this error somehow?
|
// TODO: handle this error somehow?
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -460,7 +460,7 @@ export class DataGroup {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Otherwise, or if there was an error, assume the response is expired, and evict it.
|
// Otherwise, or if there was an error, assume the response is expired, and evict it.
|
||||||
} catch (e) {
|
} catch {
|
||||||
// Some error getting the age for the response. Assume it's expired.
|
// Some error getting the age for the response. Assume it's expired.
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -546,7 +546,7 @@ export class DataGroup {
|
||||||
private async safeFetch(req: Request): Promise<Response> {
|
private async safeFetch(req: Request): Promise<Response> {
|
||||||
try {
|
try {
|
||||||
return this.scope.fetch(req);
|
return this.scope.fetch(req);
|
||||||
} catch (err) {
|
} catch {
|
||||||
return this.adapter.newResponse(null, {
|
return this.adapter.newResponse(null, {
|
||||||
status: 504,
|
status: 504,
|
||||||
statusText: 'Gateway Timeout',
|
statusText: 'Gateway Timeout',
|
||||||
|
|
|
@ -250,7 +250,7 @@ try {
|
||||||
if (window.hasOwnProperty('angular')) {
|
if (window.hasOwnProperty('angular')) {
|
||||||
angular = (<any>window).angular;
|
angular = (<any>window).angular;
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch {
|
||||||
// ignore in CJS mode.
|
// ignore in CJS mode.
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue