Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consistent Usage of ES6+ Code #430

Open
wants to merge 38 commits into
base: master
Choose a base branch
from

Conversation

DomAmato
Copy link

Just syntactical changes for other ES6+ features that were not consistent throughout the code base. There are likely more but it adds:

  • Changes Math.pow to exponentiation operator
  • Uses property shorthand when applicable
  • Changes indexOf to use includes
  • Changes function expressions to arrow expressions

Here is the benchmark output
• test/benchmark.js:

• calculator: parse.

✔  nearley  4,855.09  ops/sec  ±3.97%  (82 runs)

• json: parse sample1k.

✔  nearley  40.15  ops/sec  ±5.99%  (51 runs)

• tosh: parse.

✔  nearley  904.51  ops/sec  ±3.87%  (85 runs)

ECMAScript 7 introduced the exponentiation operator `**` so that using `Math.pow` is no longer necessary
ECMAScript 7 introduced the includes function for arrays so that bitwise and comparisons to -1 are no longer needed
ECMAScript 7 introduced the includes function for arrays so that bitwise and comparisons to -1 are no longer needed
ECMAScript 7 introduced the includes function for arrays so that bitwise and comparisons to -1 are no longer needed
Shorter syntax for common object property definition idiom.
Shorter syntax for common object property definition idiom.
Shorter syntax for common object property definition idiom.
Shorter syntax for common object property definition idiom.
Converts a function expression to the new arrow function syntax. Performs the necessary safety checks.
Applied over an entire file
Converts a function expression to the new arrow function syntax. Performs the necessary safety checks.
Applied over an entire file
Converts a function expression to the new arrow function syntax. Performs the necessary safety checks.
Applied over an entire file
Converts a function expression to the new arrow function syntax. Performs the necessary safety checks.
Applied over an entire file
Converts a function expression to the new arrow function syntax. Performs the necessary safety checks.
Applied over an entire file
Converts a function expression to the new arrow function syntax. Performs the necessary safety checks.
Applied over an entire file
Converts a function expression to the new arrow function syntax. Performs the necessary safety checks.
Applied over an entire file
Converts a function expression to the new arrow function syntax. Performs the necessary safety checks.
Applied over an entire file
Converts a function expression to the new arrow function syntax. Performs the necessary safety checks.
Applied over an entire file
Converts a function expression to the new arrow function syntax. Performs the necessary safety checks.
Applied over an entire file
Converts a function expression to the new arrow function syntax. Performs the necessary safety checks.
Applied over an entire file
Converts a function expression to the new arrow function syntax. Performs the necessary safety checks.
Applied over an entire file
Converts a function expression to the new arrow function syntax. Performs the necessary safety checks.
Applied over an entire file
Converts a function expression to the new arrow function syntax. Performs the necessary safety checks.
Applied over an entire file
Converts a function expression to the new arrow function syntax. Performs the necessary safety checks.
Applied over an entire file
Converts a function expression to the new arrow function syntax. Performs the necessary safety checks.
Applied over an entire file
Converts a function expression to the new arrow function syntax. Performs the necessary safety checks.
Applied over an entire file
Converts a function expression to the new arrow function syntax. Performs the necessary safety checks.
Applied over an entire file
Converts a function expression to the new arrow function syntax. Performs the necessary safety checks.
Applied over an entire file
Converts a function expression to the new arrow function syntax. Performs the necessary safety checks.
Applied over an entire file
Converts a function expression to the new arrow function syntax. Performs the necessary safety checks.
Applied over an entire file
Converts a function expression to the new arrow function syntax. Performs the necessary safety checks.
Applied over an entire file
kale-io and others added 8 commits March 19, 2019 20:38
Converts a function expression to the new arrow function syntax. Performs the necessary safety checks.
Applied over an entire file
Converts a function expression to the new arrow function syntax. Performs the necessary safety checks.
Applied over an entire file
Converts a function expression to the new arrow function syntax. Performs the necessary safety checks.
Applied over an entire file
Converts a function expression to the new arrow function syntax. Performs the necessary safety checks.
Applied over an entire file
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants