272-javascript-export-2-utils-classes
- Added xxxUtils.js, a (direct as possible) translation of utils classes taken from the Java export function.
- Utils functions can be called via JS console, the next commit adds UI and tests.
Discussion, see: #27
Handles #272
Fixed after feedback #72:
- Removed trailing whitespaces.
- Introduced MIN_INT / MAX_INT instead of Number.MIN_SAFE_INTEGER / Number.MAX_SAFE_INTEGER, equal to Java Integer min/max.
- Improved custom exception.
- Added backticks in the place of all {@code} tags in JSDocs.
- Fixed capitals: javascript -> JavaScript / javaScript -> JavaScript, number -> Number.
- Added space for for(), changed ++i to i++.
- div() returns integers only (truncated result).
- escape() replaces all instances, not just first instance.
- Removed makeList() and intToReal() (not required for JavaScript).
- mod() don't return -0.0 (change to 0.0, same as exp() and others).
- Refactored project() functions, renamed to projectList and projectString. Fixed projectList().
- strToInt/strToReal: Remove exception (wasn't thrown), add if check for bounds/NaN instead.
- Added TODO's with essential info.
-
TODO 1: fmt() function supports only %d and %s at the moment, which is all that's used so far. Will need to extend as more options become required.
-
TODO 2: realToStr() will need to implement some formatting code. This may become a bit messy, perhaps there is some standard function/way to do this, will discuss and do in a separate commit.
Edited by Rik Lubking