Last change
on this file since 188ee53 was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago |
initial commit
|
-
Property mode
set to
100644
|
File size:
884 bytes
|
Rev | Line | |
---|
[6a3a178] | 1 | /* eslint-disable no-new -- required for testing */
|
---|
| 2 | var global = require('../internals/global');
|
---|
| 3 | var fails = require('../internals/fails');
|
---|
| 4 | var checkCorrectnessOfIteration = require('../internals/check-correctness-of-iteration');
|
---|
| 5 | var NATIVE_ARRAY_BUFFER_VIEWS = require('../internals/array-buffer-view-core').NATIVE_ARRAY_BUFFER_VIEWS;
|
---|
| 6 |
|
---|
| 7 | var ArrayBuffer = global.ArrayBuffer;
|
---|
| 8 | var Int8Array = global.Int8Array;
|
---|
| 9 |
|
---|
| 10 | module.exports = !NATIVE_ARRAY_BUFFER_VIEWS || !fails(function () {
|
---|
| 11 | Int8Array(1);
|
---|
| 12 | }) || !fails(function () {
|
---|
| 13 | new Int8Array(-1);
|
---|
| 14 | }) || !checkCorrectnessOfIteration(function (iterable) {
|
---|
| 15 | new Int8Array();
|
---|
| 16 | new Int8Array(null);
|
---|
| 17 | new Int8Array(1.5);
|
---|
| 18 | new Int8Array(iterable);
|
---|
| 19 | }, true) || fails(function () {
|
---|
| 20 | // Safari (11+) bug - a reason why even Safari 13 should load a typed array polyfill
|
---|
| 21 | return new Int8Array(new ArrayBuffer(2), 1, undefined).length !== 1;
|
---|
| 22 | });
|
---|
Note:
See
TracBrowser
for help on using the repository browser.