• neis's avatar
    Fix order of conversions in String.prototype.substr. · f96be554
    neis authored
    The start argument must be converted to an integer before the length argument is
    converted.  (Consequently, the start argument is converted even when the length
    is 0.)  This matters because conversion is observable.
    
    Also rewrite the function in a way that closely resembles the spec text.
    
    R=littledan@chromium.org
    BUG=v8:5140
    
    Review-Url: https://codereview.chromium.org/2109583002
    Cr-Commit-Position: refs/heads/master@{#37378}
    f96be554
substr.js 5.65 KB