Closed 6utt3rfly closed 1 year ago
Use correct binding for member and function calls
Tests:
"abc".slice(1) === "bc" { foo: 'bar', test: function() { return this.foo } }.test() === 'bar'
Before this PR, the this context for the function is the context passed into the evaluate method (rather than the parent object it's a part of). Now this will match behavior even on MDN's "this" page
this
:tada: This PR is included in version 1.5.2 :tada:
The release is available on:
Your semantic-release bot :package::rocket:
Use correct binding for member and function calls
Tests:
Before this PR, the
this
context for the function is the context passed into the evaluate method (rather than the parent object it's a part of). Now this will match behavior even on MDN's "this" page