Skip to content

Commit

Permalink
Merge pull request #853 from emberjs/fix-debug-info
Browse files Browse the repository at this point in the history
Bind to object to fix debugInfo
  • Loading branch information
Bestra authored Aug 3, 2018
2 parents 96bb55d + 194a035 commit 8890240
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion ember_debug/object-inspector.js
Original file line number Diff line number Diff line change
Expand Up @@ -730,7 +730,8 @@ function getDebugInfo(object) {
let debugInfo = null;
const objectDebugInfo = get(object, '_debugInfo');
if (objectDebugInfo && typeof objectDebugInfo === 'function') {
debugInfo = objectDebugInfo();
// We have to bind to object here to make sure the `this` context is correct inside _debugInfo when we call it
debugInfo = objectDebugInfo.bind(object)();
}
debugInfo = debugInfo || {};
let propertyInfo = debugInfo.propertyInfo || (debugInfo.propertyInfo = {});
Expand Down

0 comments on commit 8890240

Please sign in to comment.