Giter VIP home page Giter VIP logo

Comments (3)

chexiongsheng avatar chexiongsheng commented on May 24, 2024

思路:
1、原生的ExecuteModule不混用v8 api,qjs api,分别按v8的回调形式和qjs的回调形式写两个,并注册到全局变量。
2、GetModuleExecutor从全局变量获取,无论ExecuteModule是用什么api实现,对其都是相当于调用一个js函数;

qjs后端的ExecuteModule纯用qjs的写法。

之前的实现对qjs的用法也有一定的误解:
1、JS_SetModuleLoaderFunc只需要调用一次;
2、其module_normalize参数是不允许抛JS异常的。

由于module_normalize参数是不允许抛JS异常,导致module_normalize的错误信息不能传递到module_loader,所以之前用例的验证需要做少许更改。

from puerts.

chexiongsheng avatar chexiongsheng commented on May 24, 2024

补充:
03b6deb

from puerts.

chexiongsheng avatar chexiongsheng commented on May 24, 2024

通过在LoadModule中JS_GetException判断是否在module_normalize抛了异常,有异常重抛实现在module_normalize中支持异常。
d05ed75

from puerts.

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.