Bug 161252

Summary: REGRESSION(r204028): Fix unused-but-set-variable warning in generated JSNavigator.cpp
Product: WebKit Reporter: Csaba Osztrogonác <ossy>
Component: New BugsAssignee: Chris Dumez <cdumez>
Status: RESOLVED FIXED    
Severity: Normal CC: cdumez, cgarcia, commit-queue, darin, esprehn+autocc, ggaren, kondapallykalyan, ossy, rniwa, sam, youennf
Priority: P2    
Version: Other   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on:    
Bug Blocks: 160394    
Attachments:
Description Flags
Patch none

Description Csaba Osztrogonác 2016-08-26 09:20:50 PDT
DerivedSources/WebCore/JSNavigator.cpp: In function 'JSC::EncodedJSValue WebCore::jsNavigatorPrototypeFunctionVibrate(JSC::ExecState*)':
DerivedSources/WebCore/JSNavigator.cpp:977:17: error: variable 'distinguishingArg' set but not used [-Werror=unused-but-set-variable]
cc1plus: all warnings being treated as errors

-------------------------------------------------------------------------------------------------------------------
EncodedJSValue JSC_HOST_CALL jsNavigatorPrototypeFunctionVibrate(ExecState* state)
{
    size_t argsCount = std::min<size_t>(1, state->argumentCount());
    if (argsCount == 1) {
        JSValue distinguishingArg = state->uncheckedArgument(0);
#if ENABLE(VIBRATION)
        if (hasIteratorMethod(*state, distinguishingArg))
            return jsNavigatorPrototypeFunctionVibrate1(state);
#endif
#if ENABLE(VIBRATION)
        if (distinguishingArg.isNumber())
            return jsNavigatorPrototypeFunctionVibrate2(state);
#endif
#if ENABLE(VIBRATION)
        return jsNavigatorPrototypeFunctionVibrate2(state);
#endif
    }
    return argsCount < 1 ? throwVMError(state, createNotEnoughArgumentsError(state)) : throwVMTypeError(state);
}
-------------------------------------------------------------------------------------------------------------------
Comment 1 Csaba Osztrogonác 2016-08-26 09:27:47 PDT
It seems it is a regression caused by https://trac.webkit.org/changeset/204028
Comment 2 Chris Dumez 2016-08-26 10:28:34 PDT
Created attachment 287118 [details]
Patch
Comment 3 WebKit Commit Bot 2016-08-26 14:36:08 PDT
Comment on attachment 287118 [details]
Patch

Clearing flags on attachment: 287118

Committed r205048: <http://trac.webkit.org/changeset/205048>
Comment 4 WebKit Commit Bot 2016-08-26 14:36:25 PDT
All reviewed patches have been landed.  Closing bug.
Comment 5 Chris Dumez 2016-08-26 17:17:51 PDT
Follow-up fix in <http://trac.webkit.org/changeset/205061>.