2016-06-23 09:47:54 -07:00
|
|
|
/**
|
|
|
|
* @license
|
2020-05-19 12:08:49 -07:00
|
|
|
* Copyright Google LLC All Rights Reserved.
|
2016-06-23 09:47:54 -07:00
|
|
|
*
|
|
|
|
* 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
|
|
|
|
*/
|
|
|
|
|
2021-05-23 22:16:02 +02:00
|
|
|
// This isn't used for anything, but for some reason Bazel won't
|
|
|
|
// serve the file if there isn't at least one import.
|
|
|
|
import '@angular/core/testing';
|
2015-09-08 12:38:19 +02:00
|
|
|
|
2017-12-15 16:28:41 -08:00
|
|
|
{
|
2015-09-08 12:38:19 +02:00
|
|
|
describe('Shim', () => {
|
|
|
|
it('should provide correct function.name ', () => {
|
2016-11-12 14:08:58 +01:00
|
|
|
const functionWithoutName = identity(() => function(_: any /** TODO #9100 */) {});
|
2017-09-22 19:51:03 +02:00
|
|
|
function foo(_: any /** TODO #9100 */) {}
|
2015-09-08 12:38:19 +02:00
|
|
|
|
2016-05-01 20:53:26 -07:00
|
|
|
expect((<any>functionWithoutName).name).toBeFalsy();
|
2015-09-08 12:38:19 +02:00
|
|
|
expect((<any>foo).name).toEqual('foo');
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
2016-05-01 20:53:26 -07:00
|
|
|
|
2016-06-08 15:45:15 -07:00
|
|
|
function identity(a: any /** TODO #9100 */) {
|
2016-05-01 22:50:37 -07:00
|
|
|
return a;
|
|
|
|
}
|