1'use strict'; 2 3// This tests that ERR_INVALID_ARG_TYPE are thrown when 4// invalid arguments are passed to TextDecoder. 5 6require('../common'); 7const assert = require('assert'); 8 9{ 10 const notArrayBufferViewExamples = [false, {}, 1, '', new Error()]; 11 notArrayBufferViewExamples.forEach((invalidInputType) => { 12 assert.throws(() => { 13 new TextDecoder(undefined, null).decode(invalidInputType); 14 }, { 15 code: 'ERR_INVALID_ARG_TYPE', 16 name: 'TypeError' 17 }); 18 }); 19} 20