Skip to content

Conversation

@alexlamsl
Copy link
Collaborator

So preventAttributesEscaping exposes a few bugs left over from HTML parser's handling of attribute quotes.

This PR fixes those plus a few tests.

function populate(index) {
customAssign = args[index];
value = args[index + 1];
if (value !== undefined) {
Copy link
Owner

Choose a reason for hiding this comment

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

Hm, I think the convention we follow with undefined checks is to do them via typeof (or just !value if it can never be falsy at that point)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

typeof v === 'undefined' is different from v === undefined in that the former allows v to not have been declared yet, whereas the latter will cause a runtime error.

So I only use the former when I need to cover that specific case, to avoid when I have a typo with v 😅

Either way I'm not too fussed, so I'll change it 😉

@alexlamsl alexlamsl merged commit eb544ce into kangax:gh-pages Apr 6, 2016
@alexlamsl alexlamsl deleted the issue-603 branch April 6, 2016 02:56
@alexlamsl alexlamsl mentioned this pull request Apr 7, 2016
alexlamsl referenced this pull request Apr 8, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants