Giter Site home page Giter Site logo

jsrt-wrappers's People

Contributors

panopticoncentral avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

jsrt-wrappers's Issues

Error in callback functions

Hi, Paul.
I'm finding some issues when defining a callback for a function property with the wrappers.

  1. 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

  2. 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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.