Skip to content
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

Merged
merged 1 commit into from
Jun 5, 2015

Conversation

teddyzeenny
Copy link
Contributor

// Legacy Ember.js < 1.13 support
let containerKey = klass._debugContainerKey;
if (containerKey) {
modelName = containerKey.match(/model:(.*)/)[1];
Copy link
Member

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?

Copy link
Contributor Author

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:?

Copy link
Contributor Author

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.

// Ideally this should always get passed a string.

var modelName = typeof modelNameOrFactory === 'string' ? modelNameOrFactory : modelNameOrFactory.modelName;
getRecords: function(klass, modelName) {
Copy link
Member

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

@teddyzeenny teddyzeenny force-pushed the debug-adapter branch 3 times, most recently from 6bb3cc4 to d7d3a88 Compare June 5, 2015 01:08
igorT added a commit that referenced this pull request Jun 5, 2015
Use string model names in debug adapter
@igorT igorT merged commit c9c5629 into emberjs:master Jun 5, 2015
@teddyzeenny teddyzeenny deleted the debug-adapter branch June 5, 2015 01:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants