Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

fix($rootScope): Set no context when calling listeners #13909

Closed
wants to merge 1 commit into from

Conversation

lgalfaso
Copy link
Contributor

When calling a listener, do not expose the inner workings with this.

@lgalfaso lgalfaso force-pushed the watch-no-context branch 3 times, most recently from a868e98 to 5b2f361 Compare January 31, 2016 14:25
@gkalpak
Copy link
Member

gkalpak commented Feb 1, 2016

The same is true for watch.get. Other than that LGTM.

When calling a $watch getter or listener, do not expose the inner workings with `this`.
function Listener() {
expect(this).toBeUndefined();
}
if (msie < 10) return;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OOC, what is the problem with IE9 ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is no "strict mode" in IE9, so this is window

gkalpak pushed a commit that referenced this pull request Feb 1, 2016
When calling a $watch getter or listener, do not expose the inner workings with `this`.

Closes: #13909
@gkalpak
Copy link
Member

gkalpak commented Feb 1, 2016

Backported to v1.4.x as ab5c769.

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

Successfully merging this pull request may close these issues.

3 participants