I noticed this because our CI (which has 1000s of tests) was crashing with a stack overflow.
The first commit in this PR contains a set of log statements that I added to demonstrate the problem. They're reverted in the second commit (and can be squashed out before merging). The third commit is the fix.
It's tricky to write a test for this that doesn't involve a very long test suite or even more monkey patching of an already complicated situation, so I opted to add some logging and to share some screenshots instead. The log statements are used to keep track of how deeply recursive the manager.didCreateElement calls get. You can see from the screenshots below that in Ember 2.12 and Ember 2.18 they grow linearly, but they should always be exactly one. The problem does not occur in Ember 3.3. After the fix is applied there are no recursive calls in any of the 3 versions I tested.
This PR fixes the bug identified in https://github.com/ember-polyfills/ember-angle-bracket-invocation-polyfill/issues/53. The fix in https://github.com/ember-polyfills/ember-angle-bracket-invocation-polyfill/pull/55 was only a partial fix: we also need to fix the monkey patching of
manager.didCreateElement
.I noticed this because our CI (which has 1000s of tests) was crashing with a stack overflow.
The first commit in this PR contains a set of log statements that I added to demonstrate the problem. They're reverted in the second commit (and can be squashed out before merging). The third commit is the fix.
It's tricky to write a test for this that doesn't involve a very long test suite or even more monkey patching of an already complicated situation, so I opted to add some logging and to share some screenshots instead. The log statements are used to keep track of how deeply recursive the
manager.didCreateElement
calls get. You can see from the screenshots below that in Ember 2.12 and Ember 2.18 they grow linearly, but they should always be exactly one. The problem does not occur in Ember 3.3. After the fix is applied there are no recursive calls in any of the 3 versions I tested.Before the fix (Ember 2.12):
Before the fix (Ember 2.18):
Before the fix (Ember 3.3):
After the fix (Ember 2.12):
After the fix (Ember 2.18):