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

IE11 fixes #55

Merged
merged 4 commits into from
Sep 16, 2019
Merged

IE11 fixes #55

merged 4 commits into from
Sep 16, 2019

Conversation

chasenlehara
Copy link
Member

This PR has a few things:

  • Fix the $not hydrator in IE
  • Fix JSHint config and linting errors
  • Set up Sauce Labs

var hydratedValue = hydrateValue(value["$not"], unknownHydrator);
var typeName = hydratedValue.constructor.name;
var hydratedValue = hydrateValue(value.$not, unknownHydrator);
var typeName = hydratedValue.constructor.name || hydratedValue.constructor.toString().match(/^\s*function\s*(\S*)\s*\(/)[1];
Copy link
Member Author

Choose a reason for hiding this comment

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

This is a hack to get IE 11 working because constructor.name isn’t available.

I think we should probably fix canjs/can-reflect#167 and add a getConstructorName method to can-reflect that returns just the constructor name (instead of something like ConstructorName{}, which is what getName returns).

Otherwise, we could maybe refactor this code to not rely on the constructor name… I think that would be a lot more involved though because there’s a lot of functions involved with the hydrateValue() call.

Copy link
Contributor

Choose a reason for hiding this comment

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

Can you explain the problem with getName? I'm not sure I follow.

Copy link
Member Author

Choose a reason for hiding this comment

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

I just realized that you can pass in a constructor function to getName and it’ll return just the name, not something like ConstructorName{}. Scratch what I said about adding a separate getConstructorName method.

This works around constructor names not being available in IE.

Closes #54
@@ -1,4 +1,4 @@
import {DefineMap, QueryLogic, Reflect as canReflect} from "can";
import {DefineMap, QueryLogic } from "can";
Copy link
Contributor

Choose a reason for hiding this comment

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

why a space at the end and not one at the beginning?

Copy link
Member Author

Choose a reason for hiding this comment

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

Find + replace mistake, fixed now.

@@ -124,9 +124,11 @@ QUnit.test("returns undefined against incompatible set", function(assert) {
var fromQuery = new BasicQuery({
filter: new BasicQuery.KeysAnd({ type: 'critical' })
});
var res;
Copy link
Contributor

Choose a reason for hiding this comment

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

Seems like the indenting is off here. Also the next line could be try { (with a space) while you're fixing this up elsewhere.

Copy link
Contributor

@phillipskevin phillipskevin left a comment

Choose a reason for hiding this comment

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

I just had a few comments about cosmetic things and one question. Nothing that should merging. Nice work.

@chasenlehara chasenlehara merged commit 97eccde into master Sep 16, 2019
@chasenlehara chasenlehara deleted the 54-ie-tests branch September 16, 2019 15:34
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.

2 participants