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 16:13:20 UTC 2015


Hi,

Thanks. Updated to check EXIT code is indeed non-zero in all the three 
calls of tryExec in test case.

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

-Sundar

On 9/3/2015 9:25 PM, Michael Haupt wrote:
> Hi Sundar,
>
> lower-case thumbs up!
>
> Best,
>
> Michael
>
>> Am 03.09.2015 um 17:44 schrieb Sundararajan Athijegannathan <sundararajan.athijegannathan at oracle.com>:
>>
>> 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