History

add missing scopeGuard changes

RTUnreal committed 8 months ago

Commit 020c3f41 parent 162fe0f2 files · +8 −4Browse files

Showing the changes to tests/script-engine/src/ScriptEngineTests.cpp (1 of 2 files). Show all

Unified · Split

tests/script-engine/src/ScriptEngineTests.cpp+6−3
@@ -187,7 +187,8 @@ void ScriptEngineTests::testRegisterClass() { · 186 unmodified lines
187 printed.append(message);187 printed.append(message);
188 });188 });
189 189
190 sm->engine()->registerGlobalObject("testClass", new TestClass());190 auto scopeGuard = sm->engine()->getScopeGuard();
191 sm->engine()->registerGlobalObject(scopeGuard.get(), "testClass", new TestClass());
191 192
192 sm->run();193 sm->run();
193 194
@@ -200,7 +201,8 @@ void ScriptEngineTests::testRegisterClass() { · 6 unmodified lines
200 201
201void ScriptEngineTests::testInvokeNonInvokable() {202void ScriptEngineTests::testInvokeNonInvokable() {
202 auto sm = makeManager("print(testClass.nonInvokableFunc(4)); Script.stop(true);", "testClass.js");203 auto sm = makeManager("print(testClass.nonInvokableFunc(4)); Script.stop(true);", "testClass.js");
203 sm->engine()->registerGlobalObject("testClass", new TestClass());204 auto scopeGuard = sm->engine()->getScopeGuard();
205 sm->engine()->registerGlobalObject(scopeGuard.get(), "testClass", new TestClass());
204 206
205 sm->run();207 sm->run();
206 auto ex = sm->getUncaughtException();208 auto ex = sm->getUncaughtException();
@@ -211,7 +213,8 @@ void ScriptEngineTests::testInvokeNonInvokable() { · 4 unmodified lines
211 213
212void ScriptEngineTests::testRaiseException() {214void ScriptEngineTests::testRaiseException() {
213 auto sm = makeManager("testClass.doRaiseTest(); Script.stop(true);", "testRaise.js");215 auto sm = makeManager("testClass.doRaiseTest(); Script.stop(true);", "testRaise.js");
214 sm->engine()->registerGlobalObject("testClass", new TestClass(sm->engine()));216 auto scopeGuard = sm->engine()->getScopeGuard();
217 sm->engine()->registerGlobalObject(scopeGuard.get(), "testClass", new TestClass(sm->engine()));
215 218
216 sm->run();219 sm->run();
217 auto ex = sm->getUncaughtException();220 auto ex = sm->getUncaughtException();