tor-browser

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

source-object-missing.js (603B)


      1 // Copyright 2015 Microsoft Corporation. All rights reserved.
      2 // This code is governed by the license found in the LICENSE file.
      3 
      4 /*---
      5 description: Source is an object with missing values
      6 esid: sec-array.from
      7 es6id: 22.1.2.1
      8 ---*/
      9 
     10 var array = [2, 4, , 16];
     11 var obj = {
     12  length: 4,
     13  0: 2,
     14  1: 4,
     15  3: 16
     16 };
     17 
     18 var a = Array.from.call(Object, obj);
     19 assert.sameValue(typeof a, "object", 'The value of `typeof a` is expected to be "object"');
     20 for (var j = 0; j < a.length; j++) {
     21  assert.sameValue(a[j], array[j], 'The value of a[j] is expected to equal the value of array[j]');
     22 }
     23 
     24 reportCompare(0, 0);