-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Use string model names in debug adapter #3203
Conversation
// Legacy Ember.js < 1.13 support | ||
let containerKey = klass._debugContainerKey; | ||
if (containerKey) { | ||
modelName = containerKey.match(/model:(.*)/)[1]; |
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.
if there is no match won't this return null, and thus error out when trying to use [1]
to access a property on null?
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.
Yes, but I couldn't think of a reason why it wouldn't match. Do you think there's a case where the model factory's container key doesn't contain model:
?
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.
I added a check just in case.
23d30fd
to
41bc413
Compare
// Ideally this should always get passed a string. | ||
|
||
var modelName = typeof modelNameOrFactory === 'string' ? modelNameOrFactory : modelNameOrFactory.modelName; | ||
getRecords: function(klass, modelName) { |
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.
i think we use modelClass for this case
6bb3cc4
to
d7d3a88
Compare
Use string model names in debug adapter
Related to emberjs/ember.js#11346