Skip to content

Commit 9b69cf5

Browse files
author
Robert Jackson
authored
Merge pull request #277 from bobisjan/resilient-result-finalization
2 parents 41ff067 + a21d52d commit 9b69cf5

2 files changed

Lines changed: 5 additions & 3 deletions

File tree

src/ember-app.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -328,12 +328,11 @@ class EmberApp {
328328
// if shoebox is not disabled, then create the shoebox and send API data
329329
createShoebox(doc, fastbootInfo);
330330
}
331-
332-
result._finalize();
333331
} catch (error) {
334332
// eslint-disable-next-line require-atomic-updates
335333
result.error = error;
336334
} finally {
335+
result._finalize();
337336
// ensure we invoke `Ember.Application.destroy()` and
338337
// `Ember.ApplicationInstance.destroy()`, but use `result._destroy()` so
339338
// that the `result` object's internal `this.isDestroyed` flag is correct

test/fastboot-test.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,10 @@ describe('FastBoot', function() {
242242

243243
return fastboot
244244
.visit('/')
245-
.then(r => r.html())
245+
.then(r => {
246+
expect(r.finalized).to.be.true;
247+
return r.html();
248+
})
246249
.then(html => {
247250
expect(html).to.match(/<body>/);
248251
});

0 commit comments

Comments
 (0)