Added generation of length validation for basic sequences (Take 2)
Added generation of length validation for basic sequences (Take 2)

Without this patch, the following will crash the tab:

navigator.vibrate(new Array(0x80000000));

Previous version of this patch (https://codereview.chromium.org/759543003/) did
not do any type checking before casting to array, which would cause crashes if
one of the affected functions was passed a non-array value when it was expecting
an array.

BUG=436217

Review URL: https://codereview.chromium.org/773493003

git-svn-id: bf5cd6ccde378db821296732a091cfbcf5285fbd@186326 bbb929c8-8fbe-4397-9dbb-9b2b20218538

primiano/blink-gitcs,primiano/blink-gitcs,primiano/blink-gitcs,primiano/blink-gitcs,primiano/blink-gitcs,primiano/blink-gitcs,primiano/blink-gitcs,primiano/blink-gitcs,primiano/blink-gitcs