test(core): fix JIT factory declaration test for IE11 (#41416)

This commit removes a check for the name of the generated factory
function, which is unimportant to test the behaviour of the code.

The name of these functions is generated from the name of the class
being instantiated. In IE11, there is no `function.name` property available
and so there is a shim for it in `third_party/shims_for_IE.js`, which patches
the `Function.property.name` property.

For performance reasons this shim writes the result of the computation
to the prototype of the function. Unfortunately, this means that any class
that extends the patched class will have the same value for `name`.

PR Close #41416
This commit is contained in:
Pete Bacon Darwin 2021-04-01 19:45:02 +01:00 committed by Alex Rickabaugh
parent 18abd3ce01
commit ed77bfea26
1 changed files with 0 additions and 1 deletions

View File

@ -32,7 +32,6 @@ describe('Factory declaration jit compilation', () => {
it('should compile a factory declaration that has inheritance', () => { it('should compile a factory declaration that has inheritance', () => {
const factory = ChildClass.ɵfac as Function; const factory = ChildClass.ɵfac as Function;
expect(factory.name).toEqual('ChildClass_Factory');
const instance = factory(); const instance = factory();
expect(instance).toBeInstanceOf(ChildClass); expect(instance).toBeInstanceOf(ChildClass);
expect(instance.testClass).toBeInstanceOf(TestClass); expect(instance.testClass).toBeInstanceOf(TestClass);