Граф коммитов

79 Коммитов

Автор SHA1 Сообщение Дата
Greg Brail d6ce38d8a6
Update SunSpider benchmarks (#1375)
Add the 1.0 version of the SunSpider suite and fix the benchmark driver so that it drives them properly.
2023-08-18 16:07:59 -07:00
Gregory Brail 1cb6002596 Remove spotless "ratchet"
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.
2022-01-28 16:18:11 -08:00
Markus Sunela 743d21c4a6 Add proper import package instructions in the OSGi manifest 2022-01-26 17:31:55 -08:00
Gregory Brail a4a6915f31 Add a NOTICE-tools to cover third-party code in the "toolsrc" directory
Fix a few other small build issues as well.
2022-01-05 16:22:13 -08:00
Greg Brail 50dd9bc62e Add rule to publish to Maven Central 2022-01-04 17:49:30 -08:00
Carlos Amengual 7c10b8275a Improve the build process to include reproducible JARs
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.
2021-12-22 16:21:23 -08:00
Carlos Amengual 2ae74e3ef8 Gradle: allow spotless in Java 17 CI & small nits
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).
2021-10-21 17:00:57 -07:00
Carlos Amengual 73a2a001f0 Fix swing tests on modular JDKs (#1039). 2021-10-15 17:03:09 -07:00
Carlos Amengual 1c727037a7 Upgrade deprecated Gradle configurations 2021-10-14 12:56:28 -07:00
Carlos Amengual f45ab167d7 Print a warning and disable 'spotless' tasks if Java version is greater than 15 and no workaround.
Closes #1036.

Add description of workaround to README
2021-10-08 16:58:10 -07:00
Gregory Brail 34057b67c9 Add support to track unhandled promise rejections
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.
2021-10-08 12:23:18 -07:00
Paul Bakker aac4a4e7bc fix: test262.properties was always generated
As the logic in build.gradle initialized the updateTest262properties
system property to an empty string, instead of the expected null value
2021-06-25 16:12:38 -07:00
Gregory Brail 38c8ed2fc6 Add a configuration for GitHub actions
This will build Rhino on Java 8, 11, and 15 for every PR.
2021-06-25 14:38:47 -07:00
Paul Bakker 263655bae3
update test262 +test262.properties file (re)generator (#930)
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
2021-06-23 14:47:57 -07:00
Paul Bakker b6e6af681d fix brackets... 2021-05-20 13:46:57 -07:00
Paul Bakker 5d4c67dcd2 Another fix... 2021-05-20 13:46:57 -07:00
Paul Bakker 4673973f30 Fix error if optLevel is NOT set 2021-05-20 13:46:57 -07:00
Paul Bakker 473474f7b6 Fix & enhance command-line testing flags
- -Dtest262properties option wasn't working
- added -DoptLevel commandline option (and made it take prio over
theTEST_262_OPTLEVEL env. var
2021-05-20 13:46:57 -07:00
Gregory Brail 64285eb04f Upgrade gradle to 7.0.1
Also upgrade "spotbugs" plugin and change a few Gradle parameters
suggested to improve performance slightly.
2021-05-14 11:14:46 -07:00
Gregory Brail 33b69660e7 Optimize addition operations
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.
2021-05-13 17:39:47 -07:00
Carlos Amengual 658273e33a Set automatic module names to rhino.jar and rhino-engine.jar
The name assigned to rhino.jar is the same as in the OSGi metadata (org.mozilla.rhino).

Closes issue #870.
2021-04-26 12:34:59 -07:00
Gregory Brail 87045099f9 Add support for lambda-based native functions
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.
2021-04-15 18:07:20 -07:00
Gregory Brail b4074d6d85 Introduce automated code formatting
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.
2021-04-15 16:41:49 -07:00
Gregory Brail 6712b50927 Upgrade versions of Gradle and other dependencies 2021-02-24 12:40:15 -08:00
Vlad 0ef1d3e07e Add option to run tests once only 2020-12-07 14:34:42 -08:00
Gregory Brail a3ac11a1ef Update release notes for 1.7.13 release
Update Gradle build so that "./gradlew publish" can work for publishing
to Maven staging repo.
2020-09-02 12:06:19 -07:00
Sylvain Jermini e76537259f try to fix circle, increase Xss 2020-06-24 16:45:01 -07:00
Sylvain Jermini e0ef690db5 travis: switch from trusty to xenial + set explicit -Xss in tests 2020-06-22 13:01:36 -07:00
Gregory Brail ef8c5df6f6 Many small fixes suggested by FindBugs and other linters
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.
2020-06-19 12:52:50 -07:00
Gregory Brail 85adf50bb6 Start using JMH for benchmarks.
Move the V8 and SunSpider benchmarks over to the JMH framework, which is
still maintained and easy to work with.
2020-06-11 16:00:13 -07:00
Gregory Brail d120651524 Implement standard Java ScriptEngine
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.
2020-06-10 17:12:49 -07:00
Gregory Brail 732566956e Upgrade Gradle version to 6.5. 2020-06-05 11:36:05 -07:00
Gregory Brail d4021ee1e9 Update for 1.7.12 release. 2020-01-13 12:38:07 -08:00
Gregory Brail 7bf6a37038 Try building a second smaller jar. 2020-01-13 11:58:30 -08:00
Gregory Brail 47c9fe849f Fix minor static analysis findings.
Clean up value of Double.NaN to use the Java default and fix
a few checks for it and for infinite values.
2019-12-28 13:32:32 -08:00
Gregory Brail bee350c9c0 Enable SpotBugs plugin.
It's configured now not to break the build for anything, although
it might prevent new bugs.

(SpotBugs used to be "FindBugs".)
2019-10-14 14:50:25 -07:00
Gregory Brail 3ac8db5ee9 Spaces, not tabs. 2019-05-30 14:14:36 -07:00
Markus Sunela 4f7f7ff8b3 Add manual OSGi manifest 2019-05-30 14:09:07 -07:00
Gregory Brail aff685e1c9 Update Gradle wrapper version. 2019-05-15 11:25:58 -07:00
rbri ed78ab1e64 Update Jacoco version
Exclude a large class that produces a coverage warning
due to large class file size every time.
2019-04-10 18:16:33 +00:00
Gregory Brail a9520588e1 Upgrade max heap for Gradle tests to 1 GB.
We are now running more than 80,000 tests, so it doesn't seem
like a problem if we need a larger heap on some platforms.
2018-11-15 12:01:38 -08:00
rbri 546b1d18b6 fix all javadoc errors and all javadoc html warnings 2018-04-10 08:01:25 -07:00
Gregory Brail 5ffd9ec5aa Upgrade Gradle to 4.3.1 and fix problems.
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.
2017-11-17 17:26:54 -08:00
Gregory Brail cacedea2e1 Fix "distZip" ZIP file contents to prevent duplicates. 2017-09-26 17:34:41 -07:00
Gregory Brail 78b9b767ed Revert "Fix "distZip" target to avoid duplicates and include"
This reverts commit 7e42dc6d49.
2017-09-26 12:44:40 -07:00
Gregory Brail 594d85171e Revert "Fix build break from fixing build.gradle."
This reverts commit f230d478c0.
2017-09-26 12:44:35 -07:00
Gregory Brail f230d478c0 Fix build break from fixing build.gradle. 2017-09-26 12:36:13 -07:00
Gregory Brail 7e42dc6d49 Fix "distZip" target to avoid duplicates and include
enough so that you can "./gradlew jar" with it.
2017-09-26 11:27:43 -07:00
Gregory Brail f3fff473ed Absolutely switch the build to use Java 1.8 bytecode. 2017-09-25 16:26:07 -07:00
Gregory Brail 9feacc02fc Change benchmark targets. 2017-09-22 10:13:33 -07:00