All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog.
0.5.0 - 2024-09-19
- The behavior of whether a JavaScript number is converted into Python
float
orint
has changed.- Before: Numbers that are valid 32-bit signed/unsigned integers (
i32
/u32
) are converted intoint
. Others are converted intofloat
. - After: Non-whole numbers are converted into
float
. Whole-number conversion is controlled by the parameterinteger_conversion
. The valid values are, in the order of increasing aggressiveness:never
: All numbers are converted intofloat
.i32
: Only valid 32-bit integers are converted intoint
. This seems to be the common behavior of other embedded JavaScript engines.safe
: Whole numbers within the safe-integer range are converted intoint
. This is the default.aggressive
: Even unsafe integers are converted intoint
.
- Before: Numbers that are valid 32-bit signed/unsigned integers (
0.4.0 - 2024-03-03
- JavaScript evaluation raises
JsError
for uncaught JavaScript exceptions. Evalution includesJsFunction
calls, andRuntime
methodseval
,mod_evaluate
,call
.- For function calls, the raised
JsError
object stores the thrown JavaScript exception in the attributevalue
.
- For function calls, the raised
Runtime.eval()
accepts an optionalname
argument, for better source code location reporting.
0.3.0 - 2024-02-19
- JavaScript values of complex types are no longer converted to Python
dict
/list
by default, but wrapped inJsObject
/JsArray
objects.- They can be recursively unwrapped with
Runtime.unwrap()
. - Methods that return a JavaScript value gain the keyword argument
unwrap
.
- They can be recursively unwrapped with
JsFunction
objects are now callable directly, without the need to useRuntime.call()
.- They can be called as methods, by passing a keyword argument
this
.
- They can be called as methods, by passing a keyword argument
Runtime.get(object, property, unwrap=False)
.
0.2.0 - 2024-02-02
- Create at most 1
Runtime
per thread, to fix the segfault when too manyRuntime
objects are created on the stack.
0.1.0 - 2024-01-19
Initial release: module loading, code evaluation, type conversions, function calls.