• Devlin Cronin's avatar
    [Extensions Bindings] Tweak signature parsing · 6cf2f700
    Devlin Cronin authored
    Signature parsing failed in cases where an optional parameter of a
    certain type was followed by a required parameter of the same type. The
    parsing was greedy, and would always use a parameter if it matched. This
    meant that passing a value like `1` to a signature that matched
    (optional int, int) would fail, because the `1` would be applied to the
    first optional int, and the second int would be missing.
    
    Tweak signature parsing to find the signature that matches the supplied
    arguments (if any possible signature matches) and resolve the arguments
    before performing parsing.
    
    Update unittests for the same.
    
    Bug: 818555
    
    Change-Id: I57c9909ff73505467fb9d333690113bea8eea433
    Reviewed-on: https://chromium-review.googlesource.com/993532Reviewed-by: default avatarIstiaque Ahmed <lazyboy@chromium.org>
    Reviewed-by: default avatarJeremy Roman <jbroman@chromium.org>
    Commit-Queue: Devlin <rdevlin.cronin@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#549527}
    6cf2f700
api_signature.cc 15.8 KB