Skip to content

Syntax errors are ignored in loaded modules #438

Description

@windbridges

When required script contains syntax errors, it silently skips it just like file was not included.

            $v8 = new V8Js();
            $v8->setModuleLoader(function ($path) {
                return 'synta}{ error!'; // returns undefined
                // return 'module.exports = 1'; // this works
            });
            $script = 'let a = require("file.js"); print(a)';
            $r = $v8->executeString($script);
            echo $r;

Is there any way to get syntax error exception when module loader returns invalid code?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions