⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 249073 in webkit


Ignore:
Timestamp:
Aug 23, 2019, 3:56:58 PM (7 years ago)
Author:
Ross Kirsling
Message:

Unreviewed WinCairo build fix following r249058.

  • API/tests/testapi.cpp:

(TestAPI::callFunction):
WinCairo chokes on JSValueRef args[sizeof...(arguments)] when there are no arguments, but AppleWin does not...
MSVC must have changed somehow.

Location:
trunk/Source/JavaScriptCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/API/tests/testapi.cpp

    r249058 r249073  
    203203}
    204204
     205#if COMPILER(MSVC)
     206template<>
     207TestAPI::ScriptResult TestAPI::callFunction(const char* functionSource)
     208{
     209    JSValueRef function;
     210    {
     211        ScriptResult functionResult = evaluateScript(functionSource);
     212        if (!functionResult)
     213            return functionResult;
     214        function = functionResult.value();
     215    }
     216
     217    JSValueRef exception = nullptr;
     218    if (JSObjectRef functionObject = JSValueToObject(context, function, &exception)) {
     219        JSValueRef result = JSObjectCallAsFunction(context, functionObject, functionObject, 0, nullptr, &exception);
     220        if (!exception)
     221            return ScriptResult(result);
     222    }
     223
     224    RELEASE_ASSERT(exception);
     225    return Unexpected<JSValueRef>(exception);
     226}
     227#endif
     228
    205229template<typename... ArgumentTypes>
    206230bool TestAPI::functionReturnsTrue(const char* functionSource, ArgumentTypes... arguments)
  • trunk/Source/JavaScriptCore/ChangeLog

    r249069 r249073  
     12019-08-23  Ross Kirsling  <ross.kirsling@sony.com>
     2
     3        Unreviewed WinCairo build fix following r249058.
     4
     5        * API/tests/testapi.cpp:
     6        (TestAPI::callFunction):
     7        WinCairo chokes on `JSValueRef args[sizeof...(arguments)]` when there are no arguments, but AppleWin does not...
     8        MSVC must have changed somehow.
     9
    1102019-08-23  Justin Michaud  <justin_michaud@apple.com>
    211
Note: See TracChangeset for help on using the changeset viewer.