tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

undefined-newtarget-throws.js (565B)


      1 // Copyright (C) 2015 André Bargull. All rights reserved.
      2 // This code is governed by the BSD license found in the LICENSE file.
      3 
      4 /*---
      5 esid: sec-arraybuffer-length
      6 description: >
      7  Throws a TypeError if ArrayBuffer is called as a function.
      8 info: |
      9  ArrayBuffer( length )
     10 
     11  ArrayBuffer called with argument length performs the following steps:
     12 
     13  1. If NewTarget is undefined, throw a TypeError exception.
     14  ...
     15 ---*/
     16 
     17 assert.throws(TypeError, function() {
     18  ArrayBuffer();
     19 });
     20 
     21 assert.throws(TypeError, function() {
     22  ArrayBuffer(10);
     23 });
     24 
     25 reportCompare(0, 0);