Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

style(*): IE is a real browser, and chakra is pretty solid #10242

Closed
wants to merge 1 commit into from

Conversation

caitp
Copy link
Contributor

@caitp caitp commented Nov 26, 2014

No description provided.

@googlebot
Copy link

CLAs look good, thanks!

@caitp caitp changed the title Make it work only in non-csp mode style(*): IE is a real browser, and chakra is pretty solid Nov 26, 2014
@caitp
Copy link
Contributor Author

caitp commented Nov 26, 2014

Ping @petebacondarwin I just did a quick grep through the codebase, I might have missed some --- want to take another look?

@@ -40,7 +40,6 @@ var scriptDirective = ['$templateCache', function($templateCache) {
compile: function(element, attr) {
if (attr.type == 'text/ng-template') {
var templateUrl = attr.id,
// IE is not consistent, in scripts we have to read .text but in other nodes we have to read .textContent
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This comment does not make sense, since text is IDL-exposed for HTMLScriptElement, and we're using it in all cases anyways.

@lgalfaso
Copy link
Contributor

otherwise, LGTM

@caitp caitp closed this in 8f05ca5 Nov 26, 2014
caitp added a commit that referenced this pull request Nov 26, 2014
- IE9+ do not have issues with Function.prototype.apply() on builtin fns (asked Brian Terlson)
  (NOTE: there may still be corner cases where builtins will not have `apply()` --- this may
  need to be reverted on complaint).
- HTMLScriptElement#text is an IDL-spec'd attribute, and we use it in all cases --- so the
  comment was sort of nonsense.
- The value of `msie` does not depend on whether the user is using a "real" browser or not.

Closes #10242
@petebacondarwin
Copy link
Contributor

I'll fix up and merge. Thanks @caitp

@caitp
Copy link
Contributor Author

caitp commented Nov 26, 2014

I already merged... I guess I'll amend this, unless you're doing it pete. THe commit message is wrong anyways

@petebacondarwin
Copy link
Contributor

Oh, OK. Amend away. I was wondering why I was getting conflicts :-)

@caitp
Copy link
Contributor Author

caitp commented Nov 26, 2014

[14:43] <bterlson> yeah that one is a different root cause
[14:43] <bterlson> and I don't think the workaround will work in that case
[14:43] <bterlson> because console.log is undefined unless dev tools are opened
[14:43] <cait> that's true
[14:44] <bterlson> although
[14:46] <bterlson> cait: console.log.call(console, "hello") works in IE11 and IETP at least, but we're kinda worried that this particular case was broken as recently as IE10

FWIW --- so in that case there may not be much we can do anyways (console.log.apply)

@caitp caitp deleted the ie-is-a-real-browser branch November 26, 2014 20:45
caitp added a commit that referenced this pull request Nov 26, 2014
@petebacondarwin
Copy link
Contributor

[14:43] because console.log is undefined unless dev tools are opened

Doesn't that mean that calling console.log in your application would cause exceptions whenever you don't have the console open?

@shahata
Copy link
Contributor

shahata commented Nov 29, 2014

That's exactly what it means. $log protects against this situation of course and calls a noop instead.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants