panopticoncentral / jsrt-wrappers Goto Github PK
View Code? Open in Web Editor NEWC++ wrapers to simplify working with the JsRT interface to the Chakra JavaScript engine.
License: Apache License 2.0
C++ wrapers to simplify working with the JsRT interface to the Chakra JavaScript engine.
License: Apache License 2.0
Hi, Paul.
I'm finding some issues when defining a callback for a function property with the wrappers.
If I use the function_base to have variable arguments I get an "index out of range" error when it unpacks the arguments (line 2659 of .h):
value_arguments[index] = value(current); // throws the exception
value_arguments[index-1] = value(current); //its working for me
when using base o any template function wrapper I get stuck in the following situation:
the jscript code correctly calls a function in the c++ code. There I throw an exception with context::set_exception for some logic problem with the arguments.
The engine gets in InException state, and so when function::thunk calls from_native to convert the result, the JsRt returns JsErrorInExceptionState and thunk throws another exception over my own (without clearing the exceptions) and I get a fatalErrorException instead of any of the original exceptions.
Editing the thunk function with this code works for me:
auto ret = from_native(result, &resultValue);
if (ret == JsErrorInExceptionState) //ADDED to check the state
return JS_INVALID_REFERENCE;
if (ret != JsNoError)
I think it should be done with all the templates.
Thanks for a great wrapper.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.