Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUGFIX beta] Add failing test for issue 16172 #16284

Conversation

kennethdavidbuck
Copy link
Contributor

Add a failing test for issue #16172

rwjblue and others added 12 commits February 14, 2018 09:45
Previously, any errors thrown during `didInsertElement` would leave the
running environment in an invalid state (`env.inTransaction` would be
`true` but `this._transaction` would have been nullified).

This commit ensures that we _always_ reset `inTransaction` if
`Environment.prototype.commit` is called. Thus avoiding an error RE:
"calling commit on null"...

(cherry picked from commit ab4a2e3)
`Ember.trySet` is designed to be an error-tolerant form of `Ember.set`
(per its public API documentation). However, in some circumstances an
error is still thrown when setting on a destroyed object.

Prior to this change, the following would properly prevent an error:

```js
let obj = { some: { deep : 'path', isDestroyed: true }};

Ember.trySet(obj, 'some.deep', 'stuff');
```

But the following would throw an error incorrectly:

```js
let obj = { some: 'path', isDestroyed: true };

Ember.trySet(obj, 'some', 'stuff');
```

This fixes the latter case...

(cherry picked from commit 1f4a3bc)
@chancancode
Copy link
Member

Closed by #17003

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants