-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Improve function names in debugger call stacks #3310
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
Conversation
src/core/a-register-element.js
Outdated
| } | ||
|
|
||
| // Give all functions their proper name. | ||
| for (const propName of Object.getOwnPropertyNames(newObj.prototype)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not an es6 codebase
| document.body.appendChild(document.createElement('a-test-entity-2')); | ||
| }); | ||
|
|
||
| test.only('Names functions correctly', function (done) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove .only, uncapitalize test name
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks!
src/core/a-register-element.js
Outdated
| // Give all functions their proper name. | ||
| for (var propName of Object.getOwnPropertyNames(newObj.prototype)) { | ||
| var propVal = newObj.prototype[propName]; | ||
| if (propVal && typeof propVal === 'function') { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is checking for if ( typeof propVal === 'function') sufficient?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, yes. Will fix.
|
There's a |
|
The |
|
You're right! The Github PR conversation is not the best to keep track of updates. |
|
Thanks! 👍 |
|
Sweet, thanks. |
Description:
Currently most functions in an A-Frame call stack are named "value" due to the way elements are defined and registered.
This change makes use of the displayName property on functions to improve call stack readability.
Before:

After:

Changes proposed: