Throw a DataCloneError if a neutered ArrayBuffer occurs in the transfer list.

Currently the exception is not thrown until after serialization.
This makes us consistent with Gecko and WebKit, which throw before serialization.

This fixes the second test case in https://github.com/w3c/web-platform-tests/pull/9672
(not yet pushed to upstream WPT).

Bug: 816447
Change-Id: I30b798b5d21dc8d6f2a40d049ced6aa7f60dd090
Reviewed-on: https://chromium-review.googlesource.com/956254
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Reviewed-by: Marijn Kruisselbrink <mek@chromium.org>
Commit-Queue: Jeremy Roman <jbroman@chromium.org>
Cr-Commit-Position: refs/heads/master@{#542484}
2 files changed