scientist2009 / pdfium

Automatically exported from code.google.com/p/pdfium
0 stars 0 forks source link

CJS_Value::m_eType is not used #60

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
A quick code search shows that this is set in 14 places, but is never used in 
any computations.  In particular,

FXJSVALUETYPE CJS_Value::GetType() const
{
    if(m_pValue.IsEmpty()) return VT_unknown;
    if(m_pValue->IsString()) return VT_string;
    if(m_pValue->IsNumber()) return VT_number;
    if(m_pValue->IsBoolean()) return VT_boolean;
    if(m_pValue->IsDate()) return VT_date;
    if(m_pValue->IsObject()) return VT_object;
    if(m_pValue->IsNull()) return VT_null;
    if(m_pValue->IsUndefined()) return VT_undefined;
    return VT_unknown;
}

sequentially interrogates the V8 types.  Seems like it would be useful to 
switch(m_eType) here, and assert the V8 type corresponds.

Original issue reported on code.google.com by tsepez@chromium.org on 28 Oct 2014 at 7:42

GoogleCodeExporter commented 9 years ago

Original comment by tsepez@chromium.org on 28 Oct 2014 at 7:43