tor-browser

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

S11.4.4_A6_T2.js (745B)


      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 info: Operator ++x evaluates its reference expression once.
      6 description: >
      7    The operand expression is evaluated exactly once. Operand expression is
      8    MemberExpression: base[prop]. base is the undefined value.
      9 ---*/
     10 
     11 function DummyError() { }
     12 
     13 assert.throws(DummyError, function() {
     14  var base = undefined;
     15  var prop = function() {
     16    throw new DummyError();
     17  };
     18 
     19  ++base[prop()];
     20 });
     21 
     22 assert.throws(TypeError, function() {
     23  var base = undefined;
     24  var prop = {
     25    toString: function() {
     26      throw new Test262Error("property key evaluated");
     27    }
     28  };
     29 
     30  ++base[prop];
     31 });
     32 
     33 reportCompare(0, 0);