tor-browser

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

set-newtarget.js (751B)


      1 // Copyright (C) 2015 the V8 project authors. All rights reserved.
      2 // This code is governed by the BSD license found in the LICENSE file.
      3 /*---
      4 esid: sec-set-constructor
      5 description: >
      6    Set ( [ iterable ] )
      7 
      8    When the Set function is called with optional argument iterable the following steps are taken:
      9 
     10    ...
     11    2. Let set be OrdinaryCreateFromConstructor(NewTarget, "%SetPrototype%", «‍[[SetData]]» ).
     12    ...
     13 
     14 ---*/
     15 
     16 var s1 = new Set();
     17 
     18 assert.sameValue(
     19  Object.getPrototypeOf(s1),
     20  Set.prototype,
     21  "`Object.getPrototypeOf(s1)` returns `Set.prototype`"
     22 );
     23 
     24 var s2 = new Set([1, 2]);
     25 
     26 assert.sameValue(
     27  Object.getPrototypeOf(s2),
     28  Set.prototype,
     29  "`Object.getPrototypeOf(s2)` returns `Set.prototype`"
     30 );
     31 
     32 reportCompare(0, 0);