tor-browser

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

length.js (727B)


      1 // Copyright (C) 2016 the V8 project authors. All rights reserved.
      2 // This code is governed by the BSD license found in the LICENSE file.
      3 /*---
      4 es6id: 21.1.4
      5 description: Instances has the own property length
      6 info: |
      7  21.1.4 Properties of String Instances
      8 
      9  ...
     10 
     11  String instances have a length property, and a set of enumerable properties
     12  with integer indexed names.
     13 includes: [propertyHelper.js]
     14 ---*/
     15 
     16 class S extends String {}
     17 
     18 var s1 = new S();
     19 
     20 verifyProperty(s1, 'length', {
     21  value: 0,
     22  writable: false,
     23  enumerable: false,
     24  configurable: false,
     25 });
     26 
     27 var s2 = new S('test262');
     28 
     29 verifyProperty(s2, 'length', {
     30  value: 7,
     31  writable: false,
     32  enumerable: false,
     33  configurable: false,
     34 });
     35 
     36 reportCompare(0, 0);