v8binding: Fix a conversion rule of optional argument of IDL operation
func(undefined, true) in JS should be treated as func("missing", IDL true) in Web IDL, and this conversion rule hasn't been implemented correctly in Blink-V8 bindings. This patch introduces a new trait IDLOptional to represent this conversion rule without changing the current behavior. For example, NativeValueTraits<IDLOptional<IDLBoolean>>::NativeValue( v8::Undefined(isolate)) returns `false` of type bool for now, but we can make it return base::nullopt of type base::Optional<bool> in future. Diff of the test expectations come from a fix of off-by-one error about argument index. Bug: 1151949 Change-Id: Ia7a478442d3c11e5d3dfe39a6e08182bd718ed90 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2563181Reviewed-by:Hitoshi Yoshida <peria@chromium.org> Commit-Queue: Yuki Shiino <yukishiino@chromium.org> Cr-Commit-Position: refs/heads/master@{#834905}
Showing
This diff is collapsed.
Please register or sign in to comment