mirror of
https://gitea.wildfiregames.com/0ad/0ad.git
synced 2026-09-21 20:06:40 +00:00
Uses std::string_view for Script::Interface::Eval
This commit is contained in:
@@ -106,7 +106,7 @@ public:
|
||||
{
|
||||
std::string input = "Test._1p_v(0);";
|
||||
JS::RootedValue val(rq.cx);
|
||||
TS_ASSERT(script.Eval(input.c_str(), &val));
|
||||
TS_ASSERT(script.Eval(input, &val));
|
||||
}
|
||||
|
||||
Script::Function::Register<&TestFunctionWrapper::_3p_r>(script, "_3p_r");
|
||||
|
||||
@@ -263,7 +263,7 @@ public:
|
||||
|
||||
std::string input = "({'x':1,'z':[2,'3\\u263A\\ud800'],\"y\":true})";
|
||||
JS::RootedValue val(rq.cx);
|
||||
TS_ASSERT(script.Eval(input.c_str(), &val));
|
||||
TS_ASSERT(script.Eval(input, &val));
|
||||
|
||||
std::string stringified = Script::StringifyJSON(rq, &val);
|
||||
TS_ASSERT_STR_EQUALS(stringified, "{\n \"x\": 1,\n \"z\": [\n 2,\n \"3\u263A\\ud800\"\n ],\n \"y\": true\n}");
|
||||
|
||||
Reference in New Issue
Block a user