test/mjsunit/stack-traces-class-fields.js
// in the stack trace produced when running the given function.
in the stack trace produced when running the given function.
in the stack trace produced when running the given function .
function testTrace(name, fun, expected, unexpected) {
  var threw = false;
  try {
    fun();
  } catch (e) {
    for (var i = 0; i < expected.length; i++) {
      assertTrue(
        e.stack.indexOf(expected[i]) != -1,
        name + " doesn't contain expected[" + i + "] stack = " + e.stack
      );
    }
    if (unexpected) {
      for (var i = 0; i < unexpected.length; i++) {
        assertEquals(
          e.stack.indexOf(unexpected[i]),
          -1,
          name + " contains unexpected[" + i + "]"
        );
      }
    }
    threw = true;
  }
  assertTrue(threw, name + " didn't throw");
}
function testTrace ( name , fun , expected , unexpected ) { var threw = false ; try { fun ( ) ; } catch ( e ) { for ( var i = 0 ; i < expected . length ; i ++ ) { assertTrue ( e . stack . indexOf ( expected [ i ] ) != - 1 , name + " doesn't contain expected[" + i + "] stack = " + e . stack ) ; } if ( unexpected ) { for ( var i = 0 ; i < unexpected . length ; i ++ ) { assertEquals ( e . stack . indexOf ( unexpected [ i ] ) , - 1 , name + " contains unexpected[" + i + "]" ) ; } } threw = true ; } assertTrue ( threw , name + " didn't throw" ) ; }
in the stack trace produced when running the given function.
in the stack trace produced when running the given function .