增加一个在native运行js代码的方法
This commit is contained in:
parent
595fd39e30
commit
5ae506a817
@ -435,6 +435,11 @@ bool jsb_run_script(const std::string& filePath, se::Value* rval/* = nullptr */)
|
||||
return se::ScriptEngine::getInstance()->runScript(filePath, rval);
|
||||
}
|
||||
|
||||
bool jsb_run_code(const std::string& coder, se::Value* rval/* = nullptr */) {
|
||||
se::AutoHandleScope hs;
|
||||
return se::ScriptEngine::getInstance()->evalString(coder.c_str(), coder.size(), rval);
|
||||
}
|
||||
|
||||
bool jsb_run_script_module(const std::string& filePath, se::Value* rval/* = nullptr */)
|
||||
{
|
||||
return doModuleRequire(filePath, rval, "");
|
||||
|
@ -42,6 +42,7 @@ void jsb_init_file_operation_delegate();
|
||||
bool jsb_enable_debugger(const std::string& debuggerServerAddr, uint32_t port, bool isWaitForConnect = false);
|
||||
bool jsb_set_extend_property(const char* ns, const char* clsName);
|
||||
bool jsb_run_script(const std::string& filePath, se::Value* rval = nullptr);
|
||||
bool jsb_run_code(const std::string& coder, se::Value* rval = nullptr);
|
||||
bool jsb_run_script_module(const std::string& filePath, se::Value* rval = nullptr);
|
||||
|
||||
void jsb_set_xxtea_key(const std::string& key);
|
||||
|
Loading…
x
Reference in New Issue
Block a user