Skip to content
  • Rob Swindell's avatar
    ad309d46
    Fix misuse of JSVAL_TO_DOUBLE() for "cost" and "size" file-meta-obj properties · ad309d46
    Rob Swindell authored
    As pointed out by echicken: when setting the "cost" property to any value, the actual
    file's cost would be set to 9223372036854776000 regardless of what number was in the
    provided file metadata object. Most jsval numbers aren't doubles (they're ints) so
    need to use JS_ValueToNumber() to do the proper conversion, regardless of underlying
    type.
    
    Noticed the same problem with the "size" property.
    
    Thanks for the tests and report echicken!
    ad309d46
    Fix misuse of JSVAL_TO_DOUBLE() for "cost" and "size" file-meta-obj properties
    Rob Swindell authored
    As pointed out by echicken: when setting the "cost" property to any value, the actual
    file's cost would be set to 9223372036854776000 regardless of what number was in the
    provided file metadata object. Most jsval numbers aren't doubles (they're ints) so
    need to use JS_ValueToNumber() to do the proper conversion, regardless of underlying
    type.
    
    Noticed the same problem with the "size" property.
    
    Thanks for the tests and report echicken!
Loading