...
 
Commits (4)
dist/*
source/app.settings.ts
node_modules/*
!node_modules/zone.js/
!drupal/
drupal/*
!drupal/modules/
......
Language: JavaScript
BasedOnStyle: Google
ColumnLimit: 100
# http://editorconfig.org
root = true
[*]
charset = utf-8
indent_style = space
indent_size = 2
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
[*.md]
insert_final_newline = false
trim_trailing_whitespace = false
build/
build-esm/
blink-core/
blink-idl/
parsed-idl/
/node_modules
.idea
.vscode
npm-debug.log
build-esm/
language: node_js
sudo: false
node_js:
- '6.3.1'
env:
global:
- BROWSER_PROVIDER_READY_FILE=/tmp/sauce-connect-ready
- LOGS_DIR=/tmp/angular-templating-build/logs
- SAUCE_USERNAME=angular-ci
- SAUCE_ACCESS_KEY=9b988f434ff8-fbca-8aa4-4ae3-35442987
# Token for tsd to increase github rate limit
# See https://github.com/DefinitelyTyped/tsd#tsdrc
# This does not use http://docs.travis-ci.com/user/environment-variables/#Secure-Variables
# because those are not visible for pull requests, and those should also be reliable.
# This SSO token belongs to github account angular-github-ratelimit-token which has no access
# (password is in Valentine)
- TSD_GITHUB_TOKEN=ef474500309daea53d5991b3079159a29520a40b
before_script:
- mkdir -p $LOGS_DIR
- ./scripts/sauce/sauce_connect_setup.sh
- ./scripts/sauce/sauce_connect_block.sh
script:
- node_modules/.bin/gulp lint
- node_modules/.bin/gulp format:enforce
- node_modules/.bin/gulp build
- scripts/closure/closure_compiler.sh
- node_modules/.bin/gulp promisetest
- npm run test:phantomjs-single
- node_modules/.bin/karma start karma-dist-sauce-jasmine.conf.js --single-run
- node_modules/.bin/karma start karma-build-sauce-mocha.conf.js --single-run
- node_modules/.bin/karma start karma-dist-sauce-selenium3-jasmine.conf.js --single-run
- node_modules/.bin/karma start karma-build-sauce-selenium3-mocha.conf.js --single-run
- node_modules/.bin/gulp test/node
- node simple-server.js 2>&1> server.log&
- node ./test/webdriver/test.sauce.js
\ No newline at end of file
This diff is collapsed.
Submitting Changes
------------------
Do NOT submit changes to the built files in the `dist` folder. These are generated before
releases.
To run tests
------------
Make sure your environment is set up with:
`npm install`
In a separate process, run the WebSockets server:
`npm run ws-server`
Run the browser tests using Karma:
`npm test`
Run the node.js tests:
`npm run test-node`
Run tslint:
`npm run lint`
Run format with clang-format:
`npm run format`
Run all checks (lint/format/browser test/test-node):
`npm run ci`
Before Commit
------------
Please make sure you pass all following checks before commit
- gulp lint (tslint)
- gulp format:enforce (clang-format)
- gulp promisetest (promise a+ test)
- npm test (karma browser test)
- gulp test-node (node test)
You can run
`npm run ci`
to do all those checks for you.
You can also add the script into your git pre-commit hook
```
echo -e 'exec npm run ci' > .git/hooks/pre-commit
chmod u+x .git/hooks/pre-commit
```
Webdriver Test
--------------
`zone.js` also supports running webdriver e2e tests.
1. run locally
```
npm run webdriver-start
npm run webdriver-http
npm run webdriver-test
```
2. run locally with sauce connect
```
// export SAUCE_USERNAME and SAUCE_ACCESS_KEY
export SAUCE_USERNAME=XXXX
export SAUCE_ACCESS_KEY=XXX
sc -u $SAUCE_USERNAME -k $SAUCE_ACCESS_KEY
npm run webdriver-http
npm run webdriver-sauce-test
```
\ No newline at end of file
The MIT License
Copyright (c) 2016 Google, Inc.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
/**
@license
The MIT License
Copyright (c) 2016 Google, Inc.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/
# Modules
Starting from zone.js v0.8.9, you can choose which web API modules you want to patch as to reduce overhead introduced by the patching of these modules. For example,
the below samples show how to disable some modules. You just need to define a few global variables
before loading zone.js.
```
<script>
__Zone_disable_Error = true; // Zone will not patch Error
__Zone_disable_on_property = true; // Zone will not patch onProperty such as button.onclick
__Zone_disable_geolocation = true; // Zone will not patch geolocation API
__Zone_disable_toString = true; // Zone will not patch Function.prototype.toString
__Zone_disable_blocking = true; // Zone will not patch alert/prompt/confirm
__Zone_disable_PromiseRejectionEvent = true; // Zone will not patch PromiseRejectionEventHandler
</script>
<script src="../dist/zone.js"></script>
```
Below is the full list of currently supported modules.
- Common
|Module Name|Behavior with zone.js patch|How to disable|
|--|--|--|
|Error|stack frames will have the Zone's name information, (By default, Error patch will not be loaded by zone.js)|__Zone_disable_Error = true|
|toString|Function.toString will be patched to return native version of toString|__Zone_disable_toString = true|
|ZoneAwarePromise|Promise.then will be patched as Zone aware MicroTask|__Zone_disable_ZoneAwarePromise = true|
|bluebird|Bluebird will use Zone.scheduleMicroTask as async scheduler. (By default, bluebird patch will not be loaded by zone.js)|__Zone_disable_bluebird = true|
- Browser
|Module Name|Behavior with zone.js patch|How to disable|
|--|--|--|
|on_property|target.onProp will become zone aware target.addEventListener(prop)|__Zone_disable_on_property = true|
|timers|setTimeout/setInterval/setImmediate will be patched as Zone MacroTask|__Zone_disable_timer = true|
|requestAnimationFrame|requestAnimationFrame will be patched as Zone MacroTask|__Zone_disable_requestAnimationFrame = true|
|blocking|alert/prompt/confirm will be patched as Zone.run|__Zone_disable_blocking = true|
|EventTarget|target.addEventListener will be patched as Zone aware EventTask|__Zone_disable_EventTarget = true|
|IE BrowserTools check|in IE, browser tool will not use zone patched eventListener|__Zone_disable_IE_check = true|
|CrossContext check|in webdriver, enable check event listener is cross context|__Zone_enable_cross_context_check = true|
|XHR|XMLHttpRequest will be patched as Zone aware MacroTask|__Zone_disable_XHR = true|
|geolocation|navigator.geolocation's prototype will be patched as Zone.run|__Zone_disable_geolocation = true|
|PromiseRejectionEvent|PromiseRejectEvent will fire when ZoneAwarePromise has unhandled error|__Zone_disable_PromiseRejectionEvent = true|
|mediaQuery|mediaQuery addListener API will be patched as Zone aware EventTask. (By default, mediaQuery patch will not be loaded by zone.js) |__Zone_disable_mediaQuery = true|
|notification|notification onProperties API will be patched as Zone aware EventTask. (By default, notification patch will not be loaded by zone.js) |__Zone_disable_notification = true|
- NodeJS
|Module Name|Behavior with zone.js patch|How to disable|
|--|--|--|
|node_timers|NodeJS patch timer|__Zone_disable_node_timers = true|
|fs|NodeJS patch fs function as macroTask|__Zone_disable_fs = true|
|EventEmitter|NodeJS patch EventEmitter as Zone aware EventTask|__Zone_disable_EventEmitter = true|
|nextTick|NodeJS patch process.nextTick as microTask|__Zone_disable_nextTick = true|
|handleUnhandledPromiseRejection|NodeJS handle unhandledPromiseRejection from ZoneAwarePromise|__Zone_disable_handleUnhandledPromiseRejection = true|
|crypto|NodeJS patch crypto function as macroTask|__Zone_disable_crypto = true|
- on_property
You can also disable specific on_properties by setting `__Zone_ignore_on_properties` as follows: for example,
if you want to disable `window.onmessage` and `HTMLElement.prototype.onclick` from zone.js patching,
you can do like this.
```
<script>
__Zone_ignore_on_properties = [
{
target: window,
ignoreProperties: ['message']
}, {
target: HTMLElement.prototype,
ignoreProperties: ['click']
}
];
</script>
<script src="../dist/zone.js"></script>
```
- Angular(2+)
Angular uses zone.js to manage async operations and decide when to perform change detection. Thus, in Angular,
the following APIs should be patched, otherwise Angular may not work as expected.
1. ZoneAwarePromise
2. timer
3. on_property
4. EventTarget
5. XHR
\ No newline at end of file
# Zone.js's support for non standard apis
Zone.js patched most standard APIs such as DOM event listeners, XMLHttpRequest in Browser, EventEmitter and fs API in Node.js so they can be in zone.
But there are still a lot of non standard APIs that are not patched by default, such as MediaQuery, Notification,
WebAudio and so on. We are adding support to those APIs, and our progress is updated here.
## Currently supported non standard Web APIs
* MediaQuery
* Notification
## Currently supported polyfills
* webcomponents
Usage:
```
<script src="webcomponents-lite.js"></script>
<script src="node_modules/zone.js/dist/zone.js"></script>
<script src="node_modules/zone.js/dist/webapis-shadydom.js"></script>
```
## Currently supported non standard node APIs
## Currently supported non standard common APIs
* bluebird promise
Browser Usage:
```
<script src="zone.js"></script>
<script src="bluebird.js"></script>
<script src="zone-bluebird.js"></script>
<script>
Zone[Zone['__symbol__']('bluebird')](Promise);
</script>
```
After those steps, window.Promise will become a ZoneAware Bluebird Promise.
Node Sample Usage:
```
require('zone.js');
const Bluebird = require('bluebird');
require('zone.js/dist/zone-bluebird');
Zone[Zone['__symbol__']('bluebird')](Bluebird);
Zone.current.fork({
name: 'bluebird'
}).run(() => {
Bluebird.resolve(1).then(r => {
console.log('result ', r, 'Zone', Zone.current.name);
});
});
```
In NodeJS environment, you can choose to use Bluebird Promise as global.Promise
or use ZoneAwarePromise as global.Promise.
To run the jasmine test cases of bluebird
```
npm install bluebird
```
then modify test/node_tests.ts
remove the comment of the following line
```
//import './extra/bluebird.spec';
```
## Others
* Cordova
patch `cordova.exec` API
`cordova.exec(success, error, service, action, args);`
`success` and `error` will be patched with `Zone.wrap`.
to load the patch, you should load in the following order.
```
<script src="zone.js"></script>
<script src="cordova.js"></script>
<script src="zone-patch-cordova.js"></script>
```
## Usage
By default, those APIs' support will not be loaded in zone.js or zone-node.js,
so if you want to load those API's support, you should load those files by yourself.
For example, if you want to add MediaQuery patch, you should do like this:
```
<script src="path/zone.js"></script>
<script src="path/webapis-media-query.js"></script>
```
* rxjs
`zone.js` also provide a `rxjs` patch to make sure rxjs Observable/Subscription/Operator run in correct zone.
For details please refer to [pull request 843](https://github.com/angular/zone.js/pull/843). The following sample code describes the idea.
```
const constructorZone = Zone.current.fork({name: 'constructor'});
const subscriptionZone = Zone.current.fork({name: 'subscription'});
const operatorZone = Zone.current.fork({name: 'operator'});
let observable;
let subscriber;
constructorZone.run(() => {
observable = new Observable((_subscriber) => {
subscriber = _subscriber;
console.log('current zone when construct observable:', Zone.current.name); // will output constructor.
return () => {
console.log('current zone when unsubscribe observable:', Zone.current.name); // will output constructor.
}
});
});
subscriptionZone.run(() => {
observable.subscribe(() => {
console.log('current zone when subscription next', Zone.current.name); // will output subscription.
}, () => {
console.log('current zone when subscription error', Zone.current.name); // will output subscription.
}, () => {
console.log('current zone when subscription complete', Zone.current.name); // will output subscription.
});
});
operatorZone.run(() => {
observable.map(() => {
console.log('current zone when map operator', Zone.current.name); // will output operator.
});
});
```
Currently basically everything the `rxjs` API includes
- Observable
- Subscription
- Subscriber
- Operators
- Scheduler
is patched, so each asynchronous call will run in the correct zone.
## Usage.
For example, in an Angular application, you can load this patch in your `app.module.ts`.
```
import 'zone.js/dist/zone-patch-rxjs';
```
# Zone.js
[![Build Status](https://travis-ci.org/angular/zone.js.png)](https://travis-ci.org/angular/zone.js)
[![CDNJS](https://img.shields.io/cdnjs/v/zone.js.svg)](https://cdnjs.com/libraries/zone.js)
Implements _Zones_ for JavaScript, inspired by [Dart](https://www.dartlang.org/articles/zones/).
> If you're using zone.js via unpkg please provide a query param `?main=browser`
`https://unpkg.com/zone.js?main=browser`
> If you're using any of the following libraries, make sure you import them first
> * 'newrelic' as it patches global.Promise before zone.js does
> * 'async-listener' as it patches global.setTimeout, global.setInterval before zone.js does
> * 'continuation-local-storage' as it uses async-listener
# NEW Zone.js POST-v0.6.0
See the new API [here](./dist/zone.js.d.ts).
Read up on [Zone Primer](https://docs.google.com/document/d/1F5Ug0jcrm031vhSMJEOgp1l-Is-Vf0UCNDY-LsQtAIY).
## What's a Zone?
A Zone is an execution context that persists across async tasks.
You can think of it as [thread-local storage](http://en.wikipedia.org/wiki/Thread-local_storage) for JavaScript VMs.
See this video from ng-conf 2014 for a detailed explanation:
[![screenshot of the zone.js presentation and ng-conf 2014](/presentation.png)](//www.youtube.com/watch?v=3IqtmUscE_U)
## See also
* [async-listener](https://github.com/othiym23/async-listener) - a similar library for node
* [Async stack traces in Chrome](http://www.html5rocks.com/en/tutorials/developertools/async-call-stack/)
* [strongloop/zone](https://github.com/strongloop/zone) (Deprecated)
* [vizone](https://github.com/gilbox/vizone) - control flow visualizer that uses zone.js
## Standard API support
zone.js patched most standard web APIs(such as DOM events, XMLHttpRequest...) and nodejs APIs
(EventEmitter,fs ...), for more details, please see [STANDARD-APIS.md](STANDARD-APIS.md).
## Non standard API support
We are adding support to some non standard APIs, such as MediaQuery and
Notification. Please see [NON-STANDARD-APIS.md](NON-STANDARD-APIS.md) for more details.
## Modules
zone.js patches the async APIs described above, but those patches will have some overhead.
Starting from zone.js v0.8.9, you can choose which web API module you want to patch.
For more details, please
see [MODULE.md](MODULE.md).
## Promise A+ test passed
[![Promises/A+ 1.1 compliant](https://promisesaplus.com/assets/logo-small.png)](https://promisesaplus.com/)
## License
MIT
# Zone.js's support for standard apis
Zone.js patched most standard APIs such as DOM event listeners, XMLHttpRequest in Browser, EventEmitter and fs API in Node.js so they can be in zone.
In this document, all patched API are listed.
For non-standard APIs, please see [NON-STANDARD-APIS.md](NON-STANDARD-APIS.md)
## Patch Mechanisms
There are several patch mechanisms
- wrap: makes callbacks run in zones, and makes applications able to receive onInvoke and onIntercept callbacks
- Task: just like in the JavaScript VM, applications can receive onScheduleTask, onInvokeTask, onCancelTask and onHasTask callbacks
1. MacroTask
2. MicroTask
3. EventTask
Some APIs which should be treated as Tasks, but are currently still patched in the wrap way. These will be patched as Tasks soon.
## Browser
Web APIs
| API | Patch Mechanism | Others |
| --- | --- | --- |
| setTimeout/clearTimeout | MacroTask | app can get handlerId, interval, args, isPeriodic(false) through task.data |
| setImmediate/clearImmediate | MacroTask | same with setTimeout |
| setInterval/clearInterval | MacroTask | isPeriodic is true, so setInterval will not trigger onHasTask callback |
| requestAnimationFrame/cancelAnimationFrame | MacroTask | |
| mozRequestAnimationFrame/mozCancelAnimationFrame | MacroTask | |
| webkitRequestAnimationFrame/webkitCancelAnimationFrame | MacroTask | |
| alert | wrap | |
| prompt | wrap | |
| confirm | wrap | |
| Promise | MicroTask | |
| EventTarget | EventTask | see below Event Target for more details |
| HTMLElement on properties | EventTask | see below on properties for more details |
| XMLHttpRequest.send/abort | MacroTask | |
| XMLHttpRequest on properties | EventTask | |
| IDBIndex on properties | EventTask | |
| IDBRequest on properties | EventTask | |
| IDBOpenDBRequest on properties | EventTask | |
| IDBDatabaseRequest on properties | EventTask | |
| IDBTransaction on properties | EventTask | |
| IDBCursor on properties | EventTask | |
| WebSocket on properties | EventTask | |
| MutationObserver | wrap | |
| WebkitMutationObserver | wrap | |
| FileReader | wrap | |
| registerElement | wrap | |
EventTarget
- For browsers supporting EventTarget, Zone.js just patches EventTarget, so everything that inherits
from EventTarget will also be patched.
- For browsers that do not support EventTarget, Zone.js will patch the following APIs in the IDL
that inherit from EventTarget
|||||
|---|---|---|---|
|ApplicationCache|EventSource|FileReader|InputMethodContext|
|MediaController|MessagePort|Node|Performance|
|SVGElementInstance|SharedWorker|TextTrack|TextTrackCue|
|TextTrackList|WebKitNamedFlow|Window|Worker|
|WorkerGlobalScope|XMLHttpRequest|XMLHttpRequestEventTarget|XMLHttpRequestUpload|
|IDBRequest|IDBOpenDBRequest|IDBDatabase|IDBTransaction|
|IDBCursor|DBIndex|WebSocket|
The following 'on' properties, such as onclick, onreadystatechange, are patched in Zone.js as EventTasks
|||||
|---|---|---|---|
|copy|cut|paste|abort|
|blur|focus|canplay|canplaythrough|
|change|click|contextmenu|dblclick|
|drag|dragend|dragenter|dragleave|
|dragover|dragstart|drop|durationchange|
|emptied|ended|input|invalid|
|keydown|keypress|keyup|load|
|loadeddata|loadedmetadata|loadstart|message|
|mousedown|mouseenter|mouseleave|mousemove|
|mouseout|mouseover|mouseup|pause|
|play|playing|progress|ratechange|
|reset|scroll|seeked|seeking|
|select|show|stalled|submit|
|suspend|timeupdate|volumechange|waiting|
|mozfullscreenchange|mozfullscreenerror|mozpointerlockchange|mozpointerlockerror|
|error|webglcontextrestored|webglcontextlost|webglcontextcreationerror|
## NodeJS
| API | Patch Mechanism | Others |
| --- | --- | --- |
| setTimeout/clearTimeout | MacroTask | app can get handlerId, interval, args, isPeriodic(false) through task.data |
| setImmediate/clearImmediate | MacroTask | same with setTimeout |
| setInterval/clearInterval | MacroTask | isPeriodic is true, so setInterval will not trigger onHasTask callback |
| process.nextTick | Microtask | isPeriodic is true, so setInterval will not trigger onHasTask callback |
| Promise | MicroTask | |
| EventEmitter | EventTask | All APIs inherit EventEmitter are patched as EventTask |
| crypto | MacroTask | |
| fs | MacroTask | all async methods are patched |
EventEmitter, addEventListener, prependEventListener and 'on' will be patched once as EventTasks, and removeEventListener and
removeAllListeners will remove those EventTasks
## Electron
Zone.js does not patch the Electron API, although in Electron both browser APIs and node APIs are patched, so
if you want to include Zone.js in Electron, please use dist/zone-mix.js
## ZoneAwareError
ZoneAwareError replaces global Error, and adds zone information to stack trace.
ZoneAwareError also handles 'this' issue.
This type of issue would happen when creating an error without `new`: `this` would be `undefined` in strict mode, and `global` in
non-strict mode. It could cause some very difficult to detect issues.
```javascript
const error = Error();
```
ZoneAwareError makes sure that `this` is ZoneAwareError even without new.
## ZoneAwarePromise
ZoneAwarePromise wraps the global Promise and makes it run in zones as a MicroTask.
It also passes promise A+ tests.
/**
* @license
* Copyright Google Inc. All Rights Reserved.
*
* 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
*/
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? factory() :
typeof define === 'function' && define.amd ? define(factory) :
(factory());
}(this, (function () { 'use strict';
/**
* @license
* Copyright Google Inc. All Rights Reserved.
*
* 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
*/
var AsyncTestZoneSpec = (function () {
function AsyncTestZoneSpec(finishCallback, failCallback, namePrefix) {
this._pendingMicroTasks = false;
this._pendingMacroTasks = false;
this._alreadyErrored = false;
this.runZone = Zone.current;
this._finishCallback = finishCallback;
this._failCallback = failCallback;
this.name = 'asyncTestZone for ' + namePrefix;
}
AsyncTestZoneSpec.prototype._finishCallbackIfDone = function () {
var _this = this;
if (!(this._pendingMicroTasks || this._pendingMacroTasks)) {
// We do this because we would like to catch unhandled rejected promises.
this.runZone.run(function () {
setTimeout(function () {
if (!_this._alreadyErrored && !(_this._pendingMicroTasks || _this._pendingMacroTasks)) {
_this._finishCallback();
}
}, 0);
});
}
};
// Note - we need to use onInvoke at the moment to call finish when a test is
// fully synchronous. TODO(juliemr): remove this when the logic for
// onHasTask changes and it calls whenever the task queues are dirty.
AsyncTestZoneSpec.prototype.onInvoke = function (parentZoneDelegate, currentZone, targetZone, delegate, applyThis, applyArgs, source) {
try {
return parentZoneDelegate.invoke(targetZone, delegate, applyThis, applyArgs, source);
}
finally {
this._finishCallbackIfDone();
}
};
AsyncTestZoneSpec.prototype.onHandleError = function (parentZoneDelegate, currentZone, targetZone, error) {
// Let the parent try to handle the error.
var result = parentZoneDelegate.handleError(targetZone, error);
if (result) {
this._failCallback(error);
this._alreadyErrored = true;
}
return false;
};
AsyncTestZoneSpec.prototype.onHasTask = function (delegate, current, target, hasTaskState) {
delegate.hasTask(target, hasTaskState);
if (hasTaskState.change == 'microTask') {
this._pendingMicroTasks = hasTaskState.microTask;
this._finishCallbackIfDone();
}
else if (hasTaskState.change == 'macroTask') {
this._pendingMacroTasks = hasTaskState.macroTask;
this._finishCallbackIfDone();
}
};
return AsyncTestZoneSpec;
}());
// Export the class so that new instances can be created with proper
// constructor params.
Zone['AsyncTestZoneSpec'] = AsyncTestZoneSpec;
})));
This diff is collapsed.
/**
* @license
* Copyright Google Inc. All Rights Reserved.
*
* 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
*/
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? factory() :
typeof define === 'function' && define.amd ? define(factory) :
(factory());
}(this, (function () { 'use strict';
/**
* @license
* Copyright Google Inc. All Rights Reserved.
*
* 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
*/
'use strict';
(function () {
var __extends = function (d, b) {
for (var p in b)
if (b.hasOwnProperty(p))
d[p] = b[p];
function __() {
this.constructor = d;
}
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
// Patch jasmine's describe/it/beforeEach/afterEach functions so test code always runs
// in a testZone (ProxyZone). (See: angular/zone.js#91 & angular/angular#10503)
if (!Zone)
throw new Error('Missing: zone.js');
if (typeof jasmine == 'undefined')
throw new Error('Missing: jasmine.js');
if (jasmine['__zone_patch__'])
throw new Error('\'jasmine\' has already been patched with \'Zone\'.');
jasmine['__zone_patch__'] = true;
var SyncTestZoneSpec = Zone['SyncTestZoneSpec'];
var ProxyZoneSpec = Zone['ProxyZoneSpec'];
if (!SyncTestZoneSpec)
throw new Error('Missing: SyncTestZoneSpec');
if (!ProxyZoneSpec)
throw new Error('Missing: ProxyZoneSpec');
var ambientZone = Zone.current;
// Create a synchronous-only zone in which to run `describe` blocks in order to raise an
// error if any asynchronous operations are attempted inside of a `describe` but outside of
// a `beforeEach` or `it`.
var syncZone = ambientZone.fork(new SyncTestZoneSpec('jasmine.describe'));
// This is the zone which will be used for running individual tests.
// It will be a proxy zone, so that the tests function can retroactively install
// different zones.
// Example:
// - In beforeEach() do childZone = Zone.current.fork(...);
// - In it() try to do fakeAsync(). The issue is that because the beforeEach forked the
// zone outside of fakeAsync it will be able to escape the fakeAsync rules.
// - Because ProxyZone is parent fo `childZone` fakeAsync can retroactively add
// fakeAsync behavior to the childZone.
var testProxyZone = null;
// Monkey patch all of the jasmine DSL so that each function runs in appropriate zone.
var jasmineEnv = jasmine.getEnv();
['describe', 'xdescribe', 'fdescribe'].forEach(function (methodName) {
var originalJasmineFn = jasmineEnv[methodName];
jasmineEnv[methodName] = function (description, specDefinitions) {
return originalJasmineFn.call(this, description, wrapDescribeInZone(specDefinitions));
};
});
['it', 'xit', 'fit'].forEach(function (methodName) {
var originalJasmineFn = jasmineEnv[methodName];
jasmineEnv[methodName] = function (description, specDefinitions, timeout) {
arguments[1] = wrapTestInZone(specDefinitions);
return originalJasmineFn.apply(this, arguments);
};
});
['beforeEach', 'afterEach'].forEach(function (methodName) {
var originalJasmineFn = jasmineEnv[methodName];
jasmineEnv[methodName] = function (specDefinitions, timeout) {
arguments[0] = wrapTestInZone(specDefinitions);
return originalJasmineFn.apply(this, arguments);
};
});
/**
* Gets a function wrapping the body of a Jasmine `describe` block to execute in a
* synchronous-only zone.
*/
function wrapDescribeInZone(describeBody) {
return function () {
return syncZone.run(describeBody, this, arguments);
};
}
/**
* Gets a function wrapping the body of a Jasmine `it/beforeEach/afterEach` block to
* execute in a ProxyZone zone.
* This will run in `testProxyZone`. The `testProxyZone` will be reset by the `ZoneQueueRunner`
*/
function wrapTestInZone(testBody) {
// The `done` callback is only passed through if the function expects at least one argument.
// Note we have to make a function with correct number of arguments, otherwise jasmine will
// think that all functions are sync or async.
return testBody && (testBody.length ? function (done) {
return testProxyZone.run(testBody, this, [done]);
} : function () {
return testProxyZone.run(testBody, this);
});
}
var QueueRunner = jasmine.QueueRunner;
jasmine.QueueRunner = (function (_super) {
__extends(ZoneQueueRunner, _super);
function ZoneQueueRunner(attrs) {
attrs.onComplete = (function (fn) { return function () {
// All functions are done, clear the test zone.
testProxyZone = null;
ambientZone.scheduleMicroTask('jasmine.onComplete', fn);
}; })(attrs.onComplete);
_super.call(this, attrs);
}
ZoneQueueRunner.prototype.execute = function () {
var _this = this;
if (Zone.current !== ambientZone)
throw new Error('Unexpected Zone: ' + Zone.current.name);
testProxyZone = ambientZone.fork(new ProxyZoneSpec());
if (!Zone.currentTask) {
// if we are not running in a task then if someone would register a
// element.addEventListener and then calling element.click() the
// addEventListener callback would think that it is the top most task and would
// drain the microtask queue on element.click() which would be incorrect.
// For this reason we always force a task when running jasmine tests.
Zone.current.scheduleMicroTask('jasmine.execute().forceTask', function () { return QueueRunner.prototype.execute.call(_this); });
}
else {
_super.prototype.execute.call(this);
}
};
return ZoneQueueRunner;
}(QueueRunner));
})();
})));
!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?n():"function"==typeof define&&define.amd?define(n):n()}(this,function(){"use strict";!function(){function e(e){return function(){return c.run(e,this,arguments)}}function n(e){return e&&(e.length?function(n){return u.run(e,this,[n])}:function(){return u.run(e,this)})}var r=function(e,n){function r(){this.constructor=e}for(var t in n)n.hasOwnProperty(t)&&(e[t]=n[t]);e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)};if(!Zone)throw new Error("Missing: zone.js");if("undefined"==typeof jasmine)throw new Error("Missing: jasmine.js");if(jasmine.__zone_patch__)throw new Error("'jasmine' has already been patched with 'Zone'.");jasmine.__zone_patch__=!0;var t=Zone.SyncTestZoneSpec,o=Zone.ProxyZoneSpec;if(!t)throw new Error("Missing: SyncTestZoneSpec");if(!o)throw new Error("Missing: ProxyZoneSpec");var i=Zone.current,c=i.fork(new t("jasmine.describe")),u=null,s=jasmine.getEnv();["describe","xdescribe","fdescribe"].forEach(function(n){var r=s[n];s[n]=function(n,t){return r.call(this,n,e(t))}}),["it","xit","fit"].forEach(function(e){var r=s[e];s[e]=function(e,t,o){return arguments[1]=n(t),r.apply(this,arguments)}}),["beforeEach","afterEach"].forEach(function(e){var r=s[e];s[e]=function(e,t){return arguments[0]=n(e),r.apply(this,arguments)}});var f=jasmine.QueueRunner;jasmine.QueueRunner=function(e){function n(n){n.onComplete=function(e){return function(){u=null,i.scheduleMicroTask("jasmine.onComplete",e)}}(n.onComplete),e.call(this,n)}return r(n,e),n.prototype.execute=function(){var n=this;if(Zone.current!==i)throw new Error("Unexpected Zone: "+Zone.current.name);u=i.fork(new o),Zone.currentTask?e.prototype.execute.call(this):Zone.current.scheduleMicroTask("jasmine.execute().forceTask",function(){return f.prototype.execute.call(n)})},n}(f)}()});
\ No newline at end of file
/**
* @license
* Copyright Google Inc. All Rights Reserved.
*
* 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
*/
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? factory() :
typeof define === 'function' && define.amd ? define(factory) :
(factory());
}(this, (function () { 'use strict';
/**
* @license
* Copyright Google Inc. All Rights Reserved.
*
* 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
*/
/**
* @fileoverview
* @suppress {globalThis}
*/
var NEWLINE = '\n';
var IGNORE_FRAMES = {};
var creationTrace = '__creationTrace__';
var ERROR_TAG = 'STACKTRACE TRACKING';
var SEP_TAG = '__SEP_TAG__';
var sepTemplate = SEP_TAG + '@[native]';
var LongStackTrace = (function () {
function LongStackTrace() {
this.error = getStacktrace();
this.timestamp = new Date();
}
return LongStackTrace;
}());
function getStacktraceWithUncaughtError() {
return new Error(ERROR_TAG);
}
function getStacktraceWithCaughtError() {
try {
throw getStacktraceWithUncaughtError();
}
catch (err) {
return err;
}
}
// Some implementations of exception handling don't create a stack trace if the exception
// isn't thrown, however it's faster not to actually throw the exception.
var error = getStacktraceWithUncaughtError();
var caughtError = getStacktraceWithCaughtError();
var getStacktrace = error.stack ?
getStacktraceWithUncaughtError :
(caughtError.stack ? getStacktraceWithCaughtError : getStacktraceWithUncaughtError);
function getFrames(error) {
return error.stack ? error.stack.split(NEWLINE) : [];
}
function addErrorStack(lines, error) {
var trace = getFrames(error);
for (var i = 0; i < trace.length; i++) {
var frame = trace[i];
// Filter out the Frames which are part of stack capturing.
if (!IGNORE_FRAMES.hasOwnProperty(frame)) {
lines.push(trace[i]);
}
}
}
function renderLongStackTrace(frames, stack) {
var longTrace = [stack ? stack.trim() : ''];
if (frames) {
var timestamp = new Date().getTime();
for (var i = 0; i < frames.length; i++) {
var traceFrames = frames[i];
var lastTime = traceFrames.timestamp;
var separator = "____________________Elapsed " + (timestamp - lastTime.getTime()) + " ms; At: " + lastTime;
separator = separator.replace(/[^\w\d]/g, '_');
longTrace.push(sepTemplate.replace(SEP_TAG, separator));
addErrorStack(longTrace, traceFrames.error);
timestamp = lastTime.getTime();
}
}
return longTrace.join(NEWLINE);
}
Zone['longStackTraceZoneSpec'] = {
name: 'long-stack-trace',
longStackTraceLimit: 10,
// add a getLongStackTrace method in spec to
// handle handled reject promise error.
getLongStackTrace: function (error) {
if (!error) {
return undefined;
}
var task = error[Zone.__symbol__('currentTask')];
var trace = task && task.data && task.data[creationTrace];
if (!trace) {
return error.stack;
}
return renderLongStackTrace(trace, error.stack);
},
onScheduleTask: function (parentZoneDelegate, currentZone, targetZone, task) {
if (Error.stackTraceLimit > 0) {
// if Error.stackTraceLimit is 0, means stack trace
// is disabled, so we don't need to generate long stack trace
// this will improve performance in some test(some test will
// set stackTraceLimit to 0, https://github.com/angular/zone.js/issues/698
var currentTask = Zone.currentTask;
var trace = currentTask && currentTask.data && currentTask.data[creationTrace] || [];
trace = [new LongStackTrace()].concat(trace);
if (trace.length > this.longStackTraceLimit) {
trace.length = this.longStackTraceLimit;
}
if (!task.data)
task.data = {};
task.data[creationTrace] = trace;
}
return parentZoneDelegate.scheduleTask(targetZone, task);
},
onHandleError: function (parentZoneDelegate, currentZone, targetZone, error) {
if (Error.stackTraceLimit > 0) {
// if Error.stackTraceLimit is 0, means stack trace
// is disabled, so we don't need to generate long stack trace
// this will improve performance in some test(some test will
// set stackTraceLimit to 0, https://github.com/angular/zone.js/issues/698
var parentTask = Zone.currentTask || error.task;
if (error instanceof Error && parentTask) {
var longStack = renderLongStackTrace(parentTask.data && parentTask.data[creationTrace], error.stack);
try {
error.stack = error.longStack = longStack;
}
catch (err) {
}
}
}
return parentZoneDelegate.handleError(targetZone, error);
}
};
function captureStackTraces(stackTraces, count) {
if (count > 0) {
stackTraces.push(getFrames((new LongStackTrace()).error));
captureStackTraces(stackTraces, count - 1);
}
}
function computeIgnoreFrames() {
if (Error.stackTraceLimit <= 0) {
return;
}
var frames = [];
captureStackTraces(frames, 2);
var frames1 = frames[0];
var frames2 = frames[1];
for (var i = 0; i < frames1.length; i++) {
var frame1 = frames1[i];
if (frame1.indexOf(ERROR_TAG) == -1) {
var match = frame1.match(/^\s*at\s+/);
if (match) {
sepTemplate = match[0] + SEP_TAG + ' (http://localhost)';
break;
}
}
}
for (var i = 0; i < frames1.length; i++) {
var frame1 = frames1[i];
var frame2 = frames2[i];
if (frame1 === frame2) {
IGNORE_FRAMES[frame1] = true;
}
else {
break;
}
}
}
computeIgnoreFrames();
})));
!function(t,r){"object"==typeof exports&&"undefined"!=typeof module?r():"function"==typeof define&&define.amd?define(r):r()}(this,function(){"use strict";function t(){return new Error(u)}function r(){try{throw t()}catch(r){return r}}function a(t){return t.stack?t.stack.split(o):[]}function e(t,r){for(var e=a(r),n=0;n<e.length;n++){var c=e[n];s.hasOwnProperty(c)||t.push(e[n])}}function n(t,r){var a=[r?r.trim():""];if(t)for(var n=(new Date).getTime(),c=0;c<t.length;c++){var i=t[c],s=i.timestamp,f="____________________Elapsed "+(n-s.getTime())+" ms; At: "+s;f=f.replace(/[^\w\d]/g,"_"),a.push(k.replace(_,f)),e(a,i.error),n=s.getTime()}return a.join(o)}function c(t,r){r>0&&(t.push(a((new h).error)),c(t,r-1))}function i(){if(!(Error.stackTraceLimit<=0)){var t=[];c(t,2);for(var r=t[0],a=t[1],e=0;e<r.length;e++){var n=r[e];if(n.indexOf(u)==-1){var i=n.match(/^\s*at\s+/);if(i){k=i[0]+_+" (http://localhost)";break}}}for(var e=0;e<r.length;e++){var n=r[e],o=a[e];if(n!==o)break;s[n]=!0}}}var o="\n",s={},f="__creationTrace__",u="STACKTRACE TRACKING",_="__SEP_TAG__",k=_+"@[native]",h=function(){function t(){this.error=T(),this.timestamp=new Date}return t}(),l=t(),d=r(),T=l.stack?t:d.stack?r:t;Zone.longStackTraceZoneSpec={name:"long-stack-trace",longStackTraceLimit:10,getLongStackTrace:function(t){if(t){var r=t[Zone.__symbol__("currentTask")],a=r&&r.data&&r.data[f];return a?n(a,t.stack):t.stack}},onScheduleTask:function(t,r,a,e){if(Error.stackTraceLimit>0){var n=Zone.currentTask,c=n&&n.data&&n.data[f]||[];c=[new h].concat(c),c.length>this.longStackTraceLimit&&(c.length=this.longStackTraceLimit),e.data||(e.data={}),e.data[f]=c}return t.scheduleTask(a,e)},onHandleError:function(t,r,a,e){if(Error.stackTraceLimit>0){var c=Zone.currentTask||e.task;if(e instanceof Error&&c){var i=n(c.data&&c.data[f],e.stack);try{e.stack=e.longStack=i}catch(o){}}}return t.handleError(a,e)}},i()});
\ No newline at end of file
/**
* @license
* Copyright Google Inc. All Rights Reserved.
*
* 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
*/
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? factory() :
typeof define === 'function' && define.amd ? define(factory) :
(factory());
}(this, (function () { 'use strict';
/**
* @license
* Copyright Google Inc. All Rights Reserved.
*
* 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
*/
'use strict';
(function (context) {
var Mocha = context.Mocha;
if (typeof Mocha === 'undefined') {
throw new Error('Missing Mocha.js');
}
if (typeof Zone === 'undefined') {
throw new Error('Missing Zone.js');
}
var ProxyZoneSpec = Zone['ProxyZoneSpec'];
var SyncTestZoneSpec = Zone['SyncTestZoneSpec'];
if (!ProxyZoneSpec) {
throw new Error('Missing ProxyZoneSpec');
}
if (Mocha['__zone_patch__']) {
throw new Error('"Mocha" has already been patched with "Zone".');
}
Mocha['__zone_patch__'] = true;
var rootZone = Zone.current;
var syncZone = rootZone.fork(new SyncTestZoneSpec('Mocha.describe'));
var testZone = null;
var suiteZone = rootZone.fork(new ProxyZoneSpec());
var mochaOriginal = {
after: Mocha.after,
afterEach: Mocha.afterEach,
before: Mocha.before,
beforeEach: Mocha.beforeEach,
describe: Mocha.describe,
it: Mocha.it
};
function modifyArguments(args, syncTest, asyncTest) {
var _loop_1 = function (i) {
var arg = args[i];
if (typeof arg === 'function') {
// The `done` callback is only passed through if the function expects at
// least one argument.
// Note we have to make a function with correct number of arguments,
// otherwise mocha will
// think that all functions are sync or async.
args[i] = (arg.length === 0) ? syncTest(arg) : asyncTest(arg);
// Mocha uses toString to view the test body in the result list, make sure we return the
// correct function body
args[i].toString = function () {
return arg.toString();
};
}
};
for (var i = 0; i < args.length; i++) {
_loop_1(i);
}
return args;
}
function wrapDescribeInZone(args) {
var syncTest = function (fn) {
return function () {
return syncZone.run(fn, this, arguments);
};
};
return modifyArguments(args, syncTest);
}
function wrapTestInZone(args) {
var asyncTest = function (fn) {
return function (done) {
return testZone.run(fn, this, [done]);
};
};
var syncTest = function (fn) {
return function () {
return testZone.run(fn, this);
};
};
return modifyArguments(args, syncTest, asyncTest);
}
function wrapSuiteInZone(args) {
var asyncTest = function (fn) {
return function (done) {
return suiteZone.run(fn, this, [done]);
};
};
var syncTest = function (fn) {
return function () {
return suiteZone.run(fn, this);
};
};
return modifyArguments(args, syncTest, asyncTest);
}
context.describe = context.suite = Mocha.describe = function () {
return mochaOriginal.describe.apply(this, wrapDescribeInZone(arguments));
};
context.xdescribe = context.suite.skip = Mocha.describe.skip = function () {
return mochaOriginal.describe.skip.apply(this, wrapDescribeInZone(arguments));
};
context.describe.only = context.suite.only = Mocha.describe.only = function () {
return mochaOriginal.describe.only.apply(this, wrapDescribeInZone(arguments));
};
context.it = context.specify = context.test = Mocha.it = function () {
return mochaOriginal.it.apply(this, wrapTestInZone(arguments));
};
context.xit = context.xspecify = Mocha.it.skip = function () {
return mochaOriginal.it.skip.apply(this, wrapTestInZone(arguments));
};
context.it.only = context.test.only = Mocha.it.only = function () {
return mochaOriginal.it.only.apply(this, wrapTestInZone(arguments));
};
context.after = context.suiteTeardown = Mocha.after = function () {
return mochaOriginal.after.apply(this, wrapSuiteInZone(arguments));
};
context.afterEach = context.teardown = Mocha.afterEach = function () {
return mochaOriginal.afterEach.apply(this, wrapTestInZone(arguments));
};
context.before = context.suiteSetup = Mocha.before = function () {
return mochaOriginal.before.apply(this, wrapSuiteInZone(arguments));
};
context.beforeEach = context.setup = Mocha.beforeEach = function () {
return mochaOriginal.beforeEach.apply(this, wrapTestInZone(arguments));
};
(function (originalRunTest, originalRun) {
Mocha.Runner.prototype.runTest = function (fn) {
var _this = this;
Zone.current.scheduleMicroTask('mocha.forceTask', function () {
originalRunTest.call(_this, fn);
});
};
Mocha.Runner.prototype.run = function (fn) {
this.on('test', function (e) {
if (Zone.current !== rootZone) {
throw new Error('Unexpected zone: ' + Zone.current.name);
}
testZone = rootZone.fork(new ProxyZoneSpec());
});
return originalRun.call(this, fn);
};
})(Mocha.Runner.prototype.runTest, Mocha.Runner.prototype.run);
})(window);
})));
!function(n,e){"object"==typeof exports&&"undefined"!=typeof module?e():"function"==typeof define&&define.amd?define(e):e()}(this,function(){"use strict";!function(n){function e(n,e,t){for(var r=function(r){var o=n[r];"function"==typeof o&&(n[r]=0===o.length?e(o):t(o),n[r].toString=function(){return o.toString()})},o=0;o<n.length;o++)r(o);return n}function t(n){var t=function(n){return function(){return s.run(n,this,arguments)}};return e(n,t)}function r(n){var t=function(n){return function(e){return a.run(n,this,[e])}},r=function(n){return function(){return a.run(n,this)}};return e(n,r,t)}function o(n){var t=function(n){return function(e){return p.run(n,this,[e])}},r=function(n){return function(){return p.run(n,this)}};return e(n,r,t)}var i=n.Mocha;if("undefined"==typeof i)throw new Error("Missing Mocha.js");if("undefined"==typeof Zone)throw new Error("Missing Zone.js");var u=Zone.ProxyZoneSpec,c=Zone.SyncTestZoneSpec;if(!u)throw new Error("Missing ProxyZoneSpec");if(i.__zone_patch__)throw new Error('"Mocha" has already been patched with "Zone".');i.__zone_patch__=!0;var f=Zone.current,s=f.fork(new c("Mocha.describe")),a=null,p=f.fork(new u),h={after:i.after,afterEach:i.afterEach,before:i.before,beforeEach:i.beforeEach,describe:i.describe,it:i.it};n.describe=n.suite=i.describe=function(){return h.describe.apply(this,t(arguments))},n.xdescribe=n.suite.skip=i.describe.skip=function(){return h.describe.skip.apply(this,t(arguments))},n.describe.only=n.suite.only=i.describe.only=function(){return h.describe.only.apply(this,t(arguments))},n.it=n.specify=n.test=i.it=function(){return h.it.apply(this,r(arguments))},n.xit=n.xspecify=i.it.skip=function(){return h.it.skip.apply(this,r(arguments))},n.it.only=n.test.only=i.it.only=function(){return h.it.only.apply(this,r(arguments))},n.after=n.suiteTeardown=i.after=function(){return h.after.apply(this,o(arguments))},n.afterEach=n.teardown=i.afterEach=function(){return h.afterEach.apply(this,r(arguments))},n.before=n.suiteSetup=i.before=function(){return h.before.apply(this,o(arguments))},n.beforeEach=n.setup=i.beforeEach=function(){return h.beforeEach.apply(this,r(arguments))},function(n,e){i.Runner.prototype.runTest=function(e){var t=this;Zone.current.scheduleMicroTask("mocha.forceTask",function(){n.call(t,e)})},i.Runner.prototype.run=function(n){return this.on("test",function(n){if(Zone.current!==f)throw new Error("Unexpected zone: "+Zone.current.name);a=f.fork(new u)}),e.call(this,n)}}(i.Runner.prototype.runTest,i.Runner.prototype.run)}(window)});
\ No newline at end of file
/**
* @license
* Copyright Google Inc. All Rights Reserved.
*
* 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
*/
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? factory() :
typeof define === 'function' && define.amd ? define(factory) :
(factory());
}(this, (function () { 'use strict';
/**
* @license
* Copyright Google Inc. All Rights Reserved.
*
* 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
*/
var ProxyZoneSpec = (function () {
function ProxyZoneSpec(defaultSpecDelegate) {