IDL Compiler: Check if value is ArrayBufferView in ToFlexibleArrayBufferView
Before this CL, ToFlexibleArrayBufferView() expected the given |value| has ArrayBufferView. But in its use cases, all in generated code, we don't check the fact, and instead, check the returned value is empty to throw an exception. FlexibleArrayBufferView var; // No check v8_var->IsArrayBufferView() ToFlexibleArrayBufferView(isolate, v8_var, var); if (var.IsEmpty()) { exception_state.ThrowTypeError(...); } To keep generated code's style, which is consistent with other ToFooBar(), this CL checks the given V8 value is in a correct type, and makes return value empty if it's not. Bug: 1029716 Change-Id: I1e58c998064b90a0a5b09f0e8895c9283a37e45b Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1949826Reviewed-by:Yuki Shiino <yukishiino@chromium.org> Commit-Queue: Hitoshi Yoshida <peria@chromium.org> Cr-Commit-Position: refs/heads/master@{#721901}
Showing
Please register or sign in to comment