Now that everything has been reformatted, we can take out the spotless
logic that compares changes to a known tag. This makes it easier for
people to clone the repo because they don't have to fetch the
optional tag.
Gradle: include license in META-INF directory of jar files (#956)
Closes https://github.com/mozilla/rhino/issues/956
Update the Rhino Shell man page, distribution fixes
1) Ship the man page in Zip/Tar distributions.
2) Include the runtime and engine jars in the distributions.
3) Do not attempt to copy non-existing `build.properties` to distributions.
4) Compress Tar distribution file.
5) Update POM metadata descriptions.
6) Upgrade deprecated jar classifier configurations.
7) Make sure that Git handles the man page as text (`.gitattributes`).
Create reproducible jar files (#1120)
1) Remove Built-Date and Built-Time fields from MANIFEST files.
2) Do not depend on Built-Date in `ImplementationVersion` (reported by @gbrail).
3) Configure archive files to be reproducible.
The JVM arguments were not being found when CI was run with Java 17, leading to
spotless being unnecessarily disabled.
The spotless warning is now only printed when the 'check' task is executed, and
the plugin is only excluded from that task. Otherwise, the warning was appearing
when running unrelated tasks.
Also, a couple of small Gradle improvements are included (one removes a warning).
This does nothing by default, but adds an object on the Context class
that tracks unhandled rejected promises and lets the user process them.
The shell now prints out warnings about unhandled rejections as it
runs and at the end of any executed script.
Cleaning up existing test262.properties file for larger changes to come,
removing wildcard matching from the 262Test runner
- Removed wildcard matching: now need to be explicit: 'name.js' wont
match any file in any subdirectory that ends with `name.js` anymore
- added all files with full path for current "wildcard" entries and
removed wildcard entries (xxxx.js, matching **/*xxxx.js)
- removed exclusions of test files that depend on unsupported features
(are filtered out/skipped anyway when running the tests)
- made sure test files within a directory are listed in a certain order
(as to be able to better compare the current test262.properties with a
generated one later on)
- marked folders containing only failing tests as excluded (instead of
listing all failing files individually)
- removed some comments
- removed unneeded ! in front of every .js file: every .js file is an
exclusion regardless and by removing the !, the filePath becomes a key
within the Java Properties format
- use ~ instead of # for excluding directories
- no need to exclude files under an already excluded directory
- add generateTest262properties commandline flag to regenerate the used
.properties file based on the test results of running the
Test262SuiteTest
- regeneration of test262.properties with default regeneration
- change default to include tests that are skipped due to relying
on unsupported features
This adds a microbenchmark for math operations and two specific
optimizations to the "add" optimization.
The first fixes some cases in which optimized math opeations would take
a slower path before a faster one (and also would not fall back
properly to BigInteger optimizations).
The second fixes string concatenation cases, especially when strings
are concatenated in a loop.
This introduces LambdaFunction and LambdaConstructor, which can be used
to represent Java lambda functions as native JavaScript functions,
and also can be used to construct an entire class out of lambdas.
This pattern is a more direct representation of the JavaScript object
model to Java than the existing reflection mechanism, and it is usable
with far less code than the IdScriptableObject class. It also outperforms
both in microbenchmarks.
This PR uses google-java-format, via the "spotless" plugin, to format
the Java code.
It uses the "ratched" mode of Spotless. That means that all Java
code committed AFTER this commit will be required to be formatted
using google-java-format. This will let us reformat the codebase
gradually rather than in one huge chunk.
We are keeping "checkstyle" as it checks for a few other things like
"star imports" that we'd still like to avoid.
Change SpotBugs report level to "medium" from "high".
Enable and annotate Java lint warnings for main source tree.
Move implementation version handling to a separate class to eliminate
weird usage of static variables.
Small fixes to string concatenation, Boolean comparison,
null checks, and dead variables.
This is not based on the now-removed JDK code but instead does a
few things in a more modern way. See the comments for supported
parameters (you can set language and optimization level via
properties) and built-in functions (only print is supported right now.)
This is built into a separate JAR called "rhino-engine" because
otherwise, including it in any Java 8 JDK would break scripts that
are expecting to see Nashorn instead.
New Gradle build is more aggressive about re-using threads,
so we need to "fork" in the test execution or else tests that
do not clean up Context correctly cause other tests to fail.
Also, fix some errors introduced by the new Checkstyle.