fix(shims): function.name to return empty string when no name
This commit is contained in:
5
modules/angular2/test/core/dom/shim_spec.dart
Normal file
5
modules/angular2/test/core/dom/shim_spec.dart
Normal file
@ -0,0 +1,5 @@
|
||||
library angular2.test.core.dom.shim_spec;
|
||||
|
||||
main() {
|
||||
// not relevant for dart.
|
||||
}
|
26
modules/angular2/test/core/dom/shim_spec.ts
Normal file
26
modules/angular2/test/core/dom/shim_spec.ts
Normal file
@ -0,0 +1,26 @@
|
||||
import {
|
||||
AsyncTestCompleter,
|
||||
beforeEach,
|
||||
ddescribe,
|
||||
describe,
|
||||
el,
|
||||
expect,
|
||||
iit,
|
||||
inject,
|
||||
it,
|
||||
xit
|
||||
} from 'angular2/test_lib';
|
||||
|
||||
export function main() {
|
||||
describe('Shim', () => {
|
||||
|
||||
it('should provide correct function.name ', () => {
|
||||
var functionWithoutName = function(_) {};
|
||||
function foo(_){};
|
||||
|
||||
expect((<any>functionWithoutName).name).toEqual('');
|
||||
expect((<any>foo).name).toEqual('foo');
|
||||
});
|
||||
|
||||
});
|
||||
}
|
Reference in New Issue
Block a user