Questions tagged [duktape]

Duktape is a highly optimized embedded JavaScript engine for C/C++

Duktape is an MIT-licensed embedded engine for /.
Its main features are :

  • Embeddable, portable, compact:
    • 200kB code
    • 46kB startup RAM (x86, default options)
    • 22kB startup RAM (x86, lowmem options)
    • 42kLoC source (excluding comments etc)
    • Can run on platforms with 256kB flash and 96kB system RAM
  • Ecmascript E5/E5.1 compliant, some features borrowed from E6 draft
  • Built-in regular expression engine
  • Built-in Unicode support
  • Minimal platform dependencies
  • Combined reference counting and mark-and-sweep garbage collection with finalization
  • Custom features like coroutines, built-in logging framework, and built-in CommonJS-based module loading framework
  • Property virtualization using a subset of Ecmascript E6 Proxy object
93 questions
-1
votes
1 answer

lambdas with duktape (using C++)

I want to call duk_push_c_function() with a lambda defined in C++, a bit like this: SomeObjType parameter; // store stuff in 'parameter' auto myLambda = [parameter](duk_context* ctx) { // do stuff with parameter return…
Peter
  • 1
  • 1
-1
votes
1 answer

Duktape - error with for of loop when evaluating

With the following code duktape gives me a parse error for the for of loop. string script = u8R"(var foo = [ "foo", "bar" ] for (var bar of foo) { print(bar); } )"; if…
meponder
  • 21
  • 5
-2
votes
1 answer

How create inserted object use duktape?

Have this code: auto obj_idx = duk_push_object( ctx ); duk_push_string( ctx, "key" ); duk_push_string( ctx, "value" ); duk_put_prop( ctx, obj_idx ); duk_push_string( ctx, "key2" ); duk_push_string( ctx, "value" ); duk_put_prop( ctx, obj_idx…
kirill-782
  • 141
  • 2
  • 9
1 2 3 4 5 6
7