Giter Club home page Giter Club logo

Comments (4)

Jayatubi avatar Jayatubi commented on May 23, 2024

After review the code I found the b_exec has already handled pre-compiled AST internally. However, since b_exec is not public I have to expose it manually somehow.

from v7.

mkmik avatar mkmik commented on May 23, 2024

hi! currently v7_exec_file will recognize the header of the precompiled file (filename extension is not significant):

$ ./v7 -c test.js >test.jsc                                        
$ ./v7 test.jsc

Do you need to exec a precompiled script from memory?

from v7.

Jayatubi avatar Jayatubi commented on May 23, 2024

Yes. What I want to is to execute the bytecode from memory. I have wrapped another interface v7_exec_bytes to accept another src_len argument, instead of the strlen.

It would be perfect If the the interface could be official supported.

enum v7_err v7_exec_bytes(struct v7 *v7, const char *js_code, size_t src_len, v7_val_t *res) {
    return b_exec(v7, js_code, src_len, NULL, V7_UNDEFINED, V7_UNDEFINED,
        V7_UNDEFINED, 0, 0, 0, res);
}

from v7.

mkmik avatar mkmik commented on May 23, 2024

yes, it makes sense; there are other reasons where the user doesn't have a null terminated string. The rest of the API always accepts string+len

from v7.

Related Issues (20)

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.