Esempio n. 1
0
bool
js::math_abs_handle(JSContext *cx, js::HandleValue v, js::MutableHandleValue r)
{
    double x;
    if (!ToNumber(cx, v, &x))
        return false;

    double z = Abs(x);
    r.setNumber(z);

    return true;
}
Esempio n. 2
0
bool JSAudioContext::JSGetter_volume(JSContext *cx, JS::MutableHandleValue vp)
{
    vp.setNumber(m_Audio->getVolume());

    return true;
}