int CJS_Runtime::Execute(const CFX_WideString& script, CFX_WideString* info) { FXJSErr error = {}; int nRet = FXJS_Execute(m_isolate, script, &error); if (nRet < 0) { info->Format(L"[ Line: %05d { %s } ] : %s", error.linnum - 1, error.srcline, error.message); } return nRet; }
TEST_F(FXJSV8Embeddertest, Getters) { v8::Isolate::Scope isolate_scope(isolate()); v8::HandleScope handle_scope(isolate()); v8::Context::Scope context_scope(GetV8Context()); FXJSErr error; int sts = FXJS_Execute(isolate(), nullptr, kScript, &error); EXPECT_EQ(0, sts); v8::Local<v8::Object> This = FXJS_GetThisObj(isolate()); v8::Local<v8::Value> fred = FXJS_GetObjectElement(isolate(), This, L"fred"); EXPECT_TRUE(fred->IsNumber()); }
void ExecuteInCurrentContext(const CFX_WideString& script) { FXJSErr error; int sts = FXJS_Execute(isolate(), script, &error); EXPECT_EQ(0, sts); }