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
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.
The text was updated successfully, but these errors were encountered:
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 <[email protected]> writes:
Hi,
I have observed the `block.js` file makes use of javascript keywords as objects keys. Ref: [here](https://github.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
Hi,
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.
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
to
Please let me know how you wish to address this, I'll submit a PR with the changes.
The text was updated successfully, but these errors were encountered: