static v8::Handle<v8::Value> clearWatchCallback(const v8::Arguments& args)
{
    INC_STATS("DOM.Geolocation.clearWatch");
    Geolocation* imp = V8Geolocation::toNative(args.Holder());
    EXCEPTION_BLOCK(int, watchId, toInt32(args[0]));
    imp->clearWatch(watchId);
    return v8::Handle<v8::Value>();
}
Esempio n. 2
0
EncodedJSValue JSC_HOST_CALL jsGeolocationPrototypeFunctionClearWatch(ExecState* exec)
{
    JSValue thisValue = exec->hostThisValue();
    if (!thisValue.inherits(&JSGeolocation::s_info))
        return throwVMTypeError(exec);
    JSGeolocation* castedThis = static_cast<JSGeolocation*>(asObject(thisValue));
    Geolocation* imp = static_cast<Geolocation*>(castedThis->impl());
    int watchId = exec->argument(0).toInt32(exec);

    imp->clearWatch(watchId);
    return JSValue::encode(jsUndefined());
}