3604884a833e443708f879ea7c84f31e1015c02a2afb38c747e84e1914616954b69ba76a59672d254504c525878e3e9d1c263a820e15d675ab3462262426d2 747 B

1234567891011121314151617181920212223242526272829
  1. 'use strict';
  2. var index = require('../');
  3. var test = require('tape');
  4. var runTests = require('./tests');
  5. test('as a function', function (t) {
  6. t.test('ArrayBuffer support', { skip: typeof ArrayBuffer === 'undefined' }, function (st) {
  7. st.test('bad array/this value', function (s2t) {
  8. s2t['throws'](function () { index(undefined); }, TypeError, 'undefined is not an object');
  9. s2t['throws'](function () { index(null); }, TypeError, 'null is not an object');
  10. s2t.end();
  11. });
  12. runTests(index, st);
  13. st.end();
  14. });
  15. t.test('no ArrayBuffer support', { skip: typeof ArrayBuffer !== 'undefined' }, function (st) {
  16. st['throws'](
  17. function () { index({}); },
  18. SyntaxError,
  19. 'ArrayBuffer is not supported'
  20. );
  21. });
  22. t.end();
  23. });