tor-browser

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

message-undefined-no-prop.js (792B)


      1 // Copyright (C) 2019 Leo Balter. All rights reserved.
      2 // This code is governed by the BSD license found in the LICENSE file.
      3 
      4 /*---
      5 esid: sec-aggregate-error
      6 description: >
      7  If message is undefined, no property will be set to the new instance
      8 info: |
      9  AggregateError ( errors, message )
     10 
     11  ...
     12  5. If message is not undefined, then
     13    a. Let msg be ? ToString(message).
     14    b. Perform ! CreateMethodProperty(O, "message", msg).
     15  6. Return O.
     16 features: [AggregateError]
     17 ---*/
     18 
     19 var case1 = new AggregateError([], undefined);
     20 
     21 assert.sameValue(
     22  Object.prototype.hasOwnProperty.call(case1, 'message'),
     23  false,
     24  'explicit'
     25 );
     26 
     27 var case2 = new AggregateError([]);
     28 
     29 assert.sameValue(
     30  Object.prototype.hasOwnProperty.call(case2, 'message'),
     31  false,
     32  'implicit'
     33 );
     34 
     35 reportCompare(0, 0);