2016-06-23 12:47:54 -04:00
|
|
|
/**
|
|
|
|
* @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
|
|
|
|
*/
|
|
|
|
|
2017-03-02 15:12:46 -05:00
|
|
|
import {describe, expect, it} from '@angular/core/testing/src/testing_internal';
|
2015-09-08 06:38:19 -04:00
|
|
|
|
2017-12-15 19:28:41 -05:00
|
|
|
{
|
2015-09-08 06:38:19 -04:00
|
|
|
describe('Shim', () => {
|
|
|
|
it('should provide correct function.name ', () => {
|
2016-11-12 08:08:58 -05:00
|
|
|
const functionWithoutName = identity(() => function(_: any /** TODO #9100 */) {});
|
2017-09-22 13:51:03 -04:00
|
|
|
function foo(_: any /** TODO #9100 */) {}
|
2015-09-08 06:38:19 -04:00
|
|
|
|
2016-05-01 23:53:26 -04:00
|
|
|
expect((<any>functionWithoutName).name).toBeFalsy();
|
2015-09-08 06:38:19 -04:00
|
|
|
expect((<any>foo).name).toEqual('foo');
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
2016-05-01 23:53:26 -04:00
|
|
|
|
2016-06-08 18:45:15 -04:00
|
|
|
function identity(a: any /** TODO #9100 */) {
|
2016-05-02 01:50:37 -04:00
|
|
|
return a;
|
|
|
|
}
|