Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在打电话Script::Compile(),结果它返回一个空句柄。我已经追踪到这个方法,最后发现
Script::Compile()
i::Handle<i::SharedFunctionInfo> result = i::Compiler::Compile(str, ....
正在返回空句柄。这意味着编译错误。
但是有谁知道在这种情况下有没有办法从编译器获取错误消息以了解发生错误的位置?
看一下示例ReportException中的函数。您需要使用 a来捕获异常并报告错误。Shellv8::TryCatch
ReportException
Shell
v8::TryCatch