Change ArrayBuffer.isView declaration to type guard for ArrayBufferView.

Also adds a test that checks that `ArrayBuffer.isView` appropriately narrows its argument to `ArrayBufferView`.

Fixes #5308.
This commit is contained in:
John Vilk
2015-10-18 20:05:30 -04:00
parent 0b580c4754
commit f10c7cc154
5 changed files with 54 additions and 1 deletions

2
src/lib/core.d.ts vendored
View File

@@ -1210,7 +1210,7 @@ interface ArrayBuffer {
interface ArrayBufferConstructor {
prototype: ArrayBuffer;
new (byteLength: number): ArrayBuffer;
isView(arg: any): boolean;
isView(arg: any): arg is ArrayBufferView;
}
declare var ArrayBuffer: ArrayBufferConstructor;