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

Fixed issue where you could not register or unregister falsy items #83

Closed

Conversation

BorisKozo
Copy link
Contributor

Fixing issue #77

Added some unit tests for the type registry
Fixed 2 typos in existing unit tests that were found due to this change

@@ -17,7 +17,11 @@ _.extend(TypeRegistry.prototype, {
// found for the specified type, the default is
// returned.
get: function(type){
return this.registeredTypes[type] || this.registeredTypes['default'];
if (this.registeredTypes.hasOwnProperty(type)){
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why won't that work in IE8?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

heh if registeredTypes is a host object it won't work :) but i guess registeredTypes will never be a host object

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is a regular object instantiated in line 8, I can test on IE8 (I am on Windows anyway... ducks)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

heheheh :) I just read a bunch about host objects, I think we are good 💃

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works with no issues in IE7 mode of IE11

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

better safe than sorry right

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That is what the drill sergeant always said during weapon training :)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It still would be good to use _.has.

@rhubarbselleven
Copy link
Contributor

👍

@rhubarbselleven
Copy link
Contributor

@BorisKozo could you change this pull request to point to merge with the minor branch?

Cheers

@BorisKozo BorisKozo closed this Feb 26, 2015
@BorisKozo BorisKozo mentioned this pull request Feb 26, 2015
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.

5 participants