-
-
Notifications
You must be signed in to change notification settings - Fork 255
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
The following are the two cleanup buckets: * `RENDERING_CLEANUP` is done when `teardownRenderingContext` is done (which should **always** be before `teardownContext` is ran). * `CLEANUP` is done _after_ everything else is destroyed and settled. --- This refactor fixes the vast majority of issues on IE11. Prior to these changes we were resetting the DOM test fixtures to their original values _before_ we had properly cleaned up the DOM. This meant that when the DOM cleanup actually does run, the various nodes being removed by glimmer's internal cleanup system are not actually present in DOM. Apparently, Chrome / FireFox / Safari / Edge are all fine with this situation (and silently allow `node.removeChild(someThingNotInNode)` without an error), but IE11 did properly (IMHO) error that `someThingNotInNode` was not found.
- Loading branch information
Showing
5 changed files
with
55 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 20 additions & 11 deletions
31
addon-test-support/@ember/test-helpers/teardown-context.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,32 @@ | ||
import { guidFor } from '@ember/object/internals'; | ||
import { run } from '@ember/runloop'; | ||
import { _teardownPromiseListeners } from './ext/rsvp'; | ||
import { _teardownAJAXHooks } from './settled'; | ||
import { unsetContext } from './setup-context'; | ||
import { nextTickPromise } from './-utils'; | ||
import { unsetContext, CLEANUP } from './setup-context'; | ||
import { nextTickPromise, runDestroyablesFor } from './-utils'; | ||
import settled from './settled'; | ||
import Ember from 'ember'; | ||
|
||
export default function(context) { | ||
return nextTickPromise().then(() => { | ||
let { owner } = context; | ||
return nextTickPromise() | ||
.then(() => { | ||
let { owner } = context; | ||
|
||
_teardownPromiseListeners(); | ||
_teardownAJAXHooks(); | ||
_teardownPromiseListeners(); | ||
_teardownAJAXHooks(); | ||
|
||
run(owner, 'destroy'); | ||
Ember.testing = false; | ||
run(owner, 'destroy'); | ||
Ember.testing = false; | ||
|
||
unsetContext(); | ||
unsetContext(); | ||
|
||
return settled(); | ||
}); | ||
return settled(); | ||
}) | ||
.finally(() => { | ||
let contextGuid = guidFor(context); | ||
|
||
runDestroyablesFor(CLEANUP, contextGuid); | ||
|
||
return settled(); | ||
}); | ||
} |
12 changes: 3 additions & 9 deletions
12
addon-test-support/@ember/test-helpers/teardown-rendering-context.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters