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

Fix 3637,3638 #3639

Closed
wants to merge 4 commits into from
Closed

Fix 3637,3638 #3639

wants to merge 4 commits into from

Conversation

sorvell
Copy link
Contributor

@sorvell sorvell commented May 6, 2016

No description provided.

Steven Orvell added 2 commits May 6, 2016 15:34
…ements when importHref is called repeatedly with the same url.
l.onerror = function(e) {
var errorListener = function(e) {
e.target.__firedError = true;
e.target.removeEventListener('error', errorListener);
return onerror.call(self, e);
}
Copy link
Contributor

Choose a reason for hiding this comment

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

The errorListener should be added as listener to the link I suppose?

Copy link
Contributor

Choose a reason for hiding this comment

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

No, import can be cached element if present var imprt = cached || link;. And below load/error events will be simulated on cached element if it is present or link will be loaded if necessary. So in either case imprt is what events will be fired on.

However, I do not understand the purpose of shortening import to imprt 😄
Also link creation might be avoided if cached import is already in place, this will save few wasted CPU cycles.

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes sorry, mistyped link instead of imprt.

@TimvdLippe
Copy link
Contributor

@sorvell Would a testcase like this verify the error callback? This should generate a 404 and trigger the on-error.

test('importHref error callback is invoked', function(done) {
  Polymer.Base.importHref('non-existing-page.html', null, done);
});

@cherukumilli
Copy link

@sorvell
@kevinpschaaf
Any updates on merging this pull request?

@sorvell
Copy link
Contributor Author

sorvell commented Jun 17, 2016

#3638 was separately closed.

#3637 is still open and this change breaks the api contract as discussed in the issue.

Closing this PR since it is no longer relevant.

@sorvell sorvell closed this Jun 17, 2016
@sorvell sorvell deleted the fix-3637,3638 branch June 17, 2016 21:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants