- Update from Duktape 2.5.0 to 2.7.0!
- Define a default fatal handler for the Duktape heap. This change only impacts heaps created via
LibDUK.create_heap
. Heaps created viaDukatpe::Context
,Duktape::Sandbox
orDuktape::Runtime
are not affected. - See the release notes for more information:
- Fix a segfault that occurs on Crystal >= 1.6.0. Thanks @z64!, #74
- Specify a
crystal
constraint of>= 0.35.1
for compatibility with Crystal 1.0.0. Thanks @Kanezoh!
- breaking change: Rename the
CRYSTAL_LOG_LEVEL
andCRYSTAL_LOG_SOURCES
environment variables toLOG_LEVEL
andLOG_SOURCES
respectively to match changes in Crystal core. - Support Crystal >= 0.35.1.
- breaking change: Remove the
Duktape::Logger
module and constants. - breaking change: Remove the
Duktape.logger
andDuktape.headerize
class methods. - breaking change: Alert messages are no longer written to STDERR. Instead they are written to STDOUT.
- Upgrade for Crystal 0.34 support! A minimum crystal version of 0.34 is required for this release.
- Add the
Duktape::Log
with theBase
,Alert
andConsole
constants that act as sources for general log messages, alert messages, and console messages. - Log messages are no longer colorized by default.
- Log output can be controlled using the newly-standardized
CRYSTAL_LOG_SOURCES
andCRYSTAL_LOG_LEVEL
environment variables. - Log output messages are now formatted by default as JSON with the following schema:
{
exception : String?,
message : String,
severity : String,
source : String,
timestamp : String
}
- Bugfix: Call function properties when using
Duktape::Runtime#call
with no function arguments. PR 58, Issue 57. Thanks @dinh for reporting!
- Update Duktape version to
2.5.0
. - See the release notes for more info.
- Add bindings for the
pull
API function.
- Update for Crystal v0.31.0 support.
- Fix test cases that were failing because Crystal's Spec library now executes
it
blocks at the end of the program (crystal-lang/crystal#8125). Instead of manually destroying the Duktape head in specs, let the GC take care of it. - Update
ameba
to 0.10.1.
- Update Duktape version to
2.4.0
. - See the release notes for more info.
- Add bindings for
to_stacktrace
,safe_to_stacktrace
,push_bare_array
,require_constructable
, andrequire_constructor_call
. - Allow C compiler flag overrides when compiling Duktape. Define the
CFLAGS
variable duringshards install
(i.e.CFLAGS=-O1 shards install
). - No longer explicitly enable Duktape's Symbol builtin as it is now enabled by default.
- Update
ameba
to the latest current version (0.10.0
) as previous versions no longer compile in CI. - Relax the restriction on
ameba
to pull in newer minor versions.
- Update
ameba
to the current latest version ofv0.9.1
. - Build specs with all warnings enabled in Crystal >=
0.28.0
. - Fix a deprecation warning with Crystal
0.28.0
where integer division will return a float in future versions. UseInt#//
to retain backwards compatibility.
- Add ameba as a development dependency for static analysis.
- Fix
ameba
lint exceptions consisting of unused variable definitions and block variables.
- Update Duktape version to
2.3.0
. - See the release notes for more info.
- Fix a missing
it
block expectation in tests. - Add bindings for
random
,push_new_target
,get_global_heaptr
andput_global_heapptr
.
- Fix a type inference error on the Sandbox
@timeout
instance variable that occurs due to recent changes in Crystal master [#43]. Thanks @kostya!
- Update Duktape to version
2.2.1
. - See the release for more info.
- Update Duktape to version
2.2.0
, rebuilding all necessary configuration and header files. - [upstream change]
LibDUK::Compile::*
andLibDUK::BufObj::*
constant values have been changed - remap these constants to their updated values. - [upstream change]
LibDUK::Bool
is now of typeUInt32
(as opposed toInt32
). - Add bindings for new public API methods:
duk_pus_proxy
,duk_seal
,duk_freeze
,duk_require_object
,duk_is_constructable
andduk_opt_xxx
methods. Theduk_opt
methods work similar toduk_require_xxx
, but allow a default value to be passed in that is used when there is no value at the given stack index. - Alias
LibDUK::Number
asFloat64
for more simple type changes in the future. - Add the
Duktape::API::Opt
module to encapsulate binding wrapper code for theduk_opt
methods implemented. - Run all code through the crystal
0.24.1
formatter. - See duktape releases for more info.
- [bugfix] - Fix an unintended
Duktape
heap instantiation when creating a newDuktape::Context
. - Run
crystal tool format
on all source code.
- [breaking change] All
LibDUK
hardcoded types are nowenum
values (i.e.LibDUK::TYPE_NULL
becomesLibDUK::Type::Null
). Where possible, methods accept both the original types as well as enumerated values. - [breaking change] Remove the
UInt32 flags
arguments from allDuktape::Context#compile
methods. - [breaking change] Remove some bindings from
LibDUK
as they were removed upstream. See duktape releases for more info. - Update Duktape to
v2.0.2
. - Add
Duktape::Builtin
helpers that allow for modular extensions into aDuktape::Context
instance. - Add builtins for
console.log
,alert
andprint
. - Implement file operations natively in Crystal as they have been removed from Duktape.
- The Duktape stack is no longer logged as a debug value when
Duktape::InternalError
is raised. - Alias
Int32
asLibDUK::Index
to allow for quicker changes to indexes in the future.
- Fix compiler issues with Crystal
0.23.0
by makingDuktape::Logger#log_color
accept aLogger::Severity
. [@kostya, #35]
- Fix an incorrect type restriction that was causing compiler issues on recent Crystal versions.
- Fix Sandbox timeout tests by no longer running a set number of iterations - instead infinite loop until timeout.
- Update for Crystal 0.20.0. As shards now copies
the entire shard directory into
libs
, we can move theext
directory to the shard root directory for simplicity. - Update makefile output paths to match new structure.
- Resolve #25
by allowing a developer to pass a
Duktape::Context
instance when initializing aDuktape::Runtime
. This allows the runtime to use the internalDuktape
global object.
- Update Duktape to
v1.5.1
. See release info.
- Update Duktape to
v1.5.0
. See release info. - Update to Crystal
0.17.4
syntax. - Format code using Crystal
0.17.4
formatter. - Add
NamedTuple
as a type that is allowed as parameter tocall
on aDuktape::Runtime
instance. NamedTuples will be translated to a hash. - Optimize for speed (-O2) instead of size (-0s) when building the duktape library.
- Use -Wpedantic as the compiler flag for warnings.
- Update to Crystal
0.16.0
syntax.
- Update to Crystal
0.14.2
syntax. - Refactor
API::Eval
code for readability.
- (breaking change) JS errors are now mapped to their proper Crystal exceptions. i.e. JS
SyntaxError
becomesDuktape::SyntaxError
. - (breaking change) Make all exception classes more consistent. Instances of
Duktape::Error
are all recoverable exceptions that are thrown by the engine at runtime (eg.Duktape::TypeError
). Instances ofDuktape::InternalError
are generally non-recoverable for a given context (eg.Duktape::HeapError
). - Added
call_success
,call_failure
andreturn_undefined
convenience methods that provide the appropriate integer status codes when returning from a native function call. - Added the
push_global_proc
method that simplifies pushing a named native function to the stack. Duktape::Runtime
instances may now accept a execution timeout value in milliseconds upon creation. [#15, @raydf].- Changed the name in the
shard.yml
fromduktape.cr
toduktape
. This should have no effect on the installation process.
- (breaking change) A monkeypatch to the Crystal
Logger
class was temporarily added to master to fix a bug in core Crystal (#1982). This patch has now been removed from the codebase. Crystalv0.10.1
or higher is a requirement for this library. Duktape::Runtime
instances now return Crystal arrays and hashes for corresponding JS arrays and objects.Duktape::Runtime
can now accept hashes and arrays as arguments for call. These will be translated into Javascript objects and pushed to the stack.- Updated Duktape version to
v1.4.0
. See release info.
- Add the
src/runtime.cr
file so you can now properlyrequire "./duktape/runtime"
onceshards
does its thing. - Actually update the version in
shard.yml
(my mistake - sorry!).
NOTE - This release has issues, use 0.6.4
instead.
- Rework the internal require order and
duktape/base
. - Add a
Duktape::Runtime
class that lessens the need for low-level API calls for many use-cases. This must be required usingrequire "duktape/runtime"
.
- Update Duktape version to
v1.3.1
. See release info. - More consistent exception classes in
error.cr
. - Removed a few unecessary method calls from spec files.
- Adopt Crystal
0.9.1
code formatting.
- Update to Crystal
v0.8.0
syntax/compatibility. - Fix a potential use-after-free scenario that may occur when
Context
orSandbox
instances were garbage-collected by Crystal. - The Duktape heap is no longer destroyed when a
Duktape::InternalError
is thrown in Crystal. Instead, the heap will be destroyed automatically upon finalization.
- Update Duktape to
v1.3.0
. This update does not break exisiting functionality. See release info. - Implement a timeout mechanism for
Duktape::Sandbox
instances. A timeout is not specified by default.
A timeout may be specified (in milliseconds) as such:
sbx = Duktape::Sandbox.new(500) # 500 millisecond execution limit
- Add this
CHANGLEOG
. - Fix issue #1 by linking against standard math library.
- Cleanup
Makefile
syntax.
- Initial public release.