In V8 why does Isolate::GetCurrent() return NULL?

喜夏-厌秋 提交于 2019-12-04 16:25:45

I have the same issue. I don't really know the underlying reason, but NULL here means default isolate was not created and entered. The obvious workaround is to do it manually

Isolate* isolate = Isolate::GetCurrent(); // returns NULL
if (!isolate) {
    isolate = Isolate::New();
    isolate->Enter();
}

The default isolate has been removed from v8. As a result, GetCurrent() is no longer initialized by default.

Here's the issue for the change: https://code.google.com/p/chromium/issues/detail?id=359977

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!