RFR 8087292: nashorn should have a "fail-fast" option for scripting, analog to bash "set -e"

Sundararajan Athijegannathan sundararajan.athijegannathan at oracle.com
Thu Sep 3 15:44:17 UTC 2015


Updated webrev: http://cr.openjdk.java.net/~sundar/8087292/webrev.01/

Updates:

* Added throwOnError property (false default) to $EXEC function object
* Added a test case (suggested by Michael offline)

On RangeError: I interpreted as { 0 } as only "expected" set of exit 
code values. Anything outside that is a "range error" as /RangeError/ 
object indicates an error when a value is not in the set or range of 
allowed values

Thanks,
-Sundar

On 9/3/2015 7:07 PM, Hannes Wallnoefer wrote:
> Two suggestions:
>
> The return code is just the "messenger" and we don't know what went 
> wrong, so I would prefer to use plain Error instead of RangeError.
> And maybe we could set $EXEC.throwOnError = false by default so this 
> feature was easier to discover.
>
> Hannes
>
> Am 2015-09-03 um 15:33 schrieb Sundararajan Athijegannathan:
>> Please review http://cr.openjdk.java.net/~sundar/8087292/ for 
>> https://bugs.openjdk.java.net/browse/JDK-8087292
>>
>> Thanks,
>> -Sundar
>



More information about the nashorn-dev mailing list