🌐 AI搜索 & 代理 主页
Skip to content

Conversation

@markelog
Copy link
Member

  • It seems, check for html element (and previously for body element)
    was redundant
  • Simplify "return" statement
  • Add comment about potential errors that didn't find themselves in real life app

This code would work even in IE6 quirks mode

Copy link
Member Author

Choose a reason for hiding this comment

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

These exceptions would be better to put in the documentation too or instead of

Copy link
Member

Choose a reason for hiding this comment

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

If these are pathological cases that don't occur in real life, I am not sure why we are commenting them anyway. The result might change in a refactoring and these comments would no longer be true, but people might have read them as documented and supported.

Copy link
Member Author

Choose a reason for hiding this comment

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

How about i will add a notice about it, like "But this is undefined and undocumented behavior, could be changed at any point" or something like that.

It feels weird to know about these edge cases, but not put some info about them somewhere.

Copy link
Member

Choose a reason for hiding this comment

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

It really does seem like this is documentation. I am okay with putting a comment like "this is not guaranteed" nearby though and we can hope we don't need to change it.

* It seems, check for html element (and previously for body element)
  was redundant

* Simplify "return" statement

* Add comment about potential errors that didn't find themselves in real life app
@dmethvin
Copy link
Member

Seems like this should address gh-1765 as well since that will change the same code.

@markelog markelog closed this in 74ae544 Jan 13, 2015
markelog added a commit that referenced this pull request Nov 10, 2015
* It seems, check for html element (and previously for body element)
  was redundant

* Simplify "return" statement

* Add comment about potential errors that didn't find themselves
  in real life app

Closes gh-1968
@lock lock bot locked as resolved and limited conversation to collaborators Jan 19, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Development

Successfully merging this pull request may close these issues.

2 participants