If you think a bug might affect users in the 57 release, please set the correct tracking and status flags for Release Management.

1.7R4 regression: cannot pass bound functions to java methods accepting Callable

UNCONFIRMED
Unassigned

Status

Rhino
Core
UNCONFIRMED
4 years ago
4 years ago

People

(Reporter: Stefan Praszalowicz, Unassigned)

Tracking

Details

Attachments

(1 attachment)

(Reporter)

Description

4 years ago
Created attachment 745235 [details]
rhino17r4-boundfunction-callable-fix.diff

User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_5) AppleWebKit/537.31 (KHTML, like Gecko) Chrome/26.0.1410.65 Safari/537.31

Steps to reproduce:

Updated rhino to 1.7R4 from 1.7R3



Actual results:

Javascript code that passes a bound function to java methods that take Callable stopped working; for example something like the following

 executorService.submit(callback.bind(this, item));

breaks with:

org.mozilla.javascript.EvaluatorException: Cannot convert org.mozilla.javascript.BoundFunction@5dc1bab3 to java.util.concurrent.Callable



Expected results:

Rhino should adapt bound functions like it did in previous releases.

Maybe BoundFunction should be adapted like NativeObject and NativeFunction - if so, I have a pull request that does that here:

https://github.com/stefanp/rhino/commit/7caab74517121388cb421c937ded7ecb823c2f2b

Also attaching the diff (against 1.7R4) here for convenience.
You need to log in before you can comment on or make changes to this bug.