tor-browser

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

12.10.1-10-s-strict.js (650B)


      1 'use strict';
      2 // Copyright (c) 2012 Ecma International.  All rights reserved.
      3 // This code is governed by the BSD license found in the LICENSE file.
      4 
      5 /*---
      6 es5id: 12.10.1-10-s
      7 description: >
      8    with statement in strict mode throws SyntaxError (eval, where the
      9    container function is strict)
     10 flags: [onlyStrict]
     11 ---*/
     12 
     13  // wrapping it in eval since this needs to be a syntax error. The
     14  // exception thrown must be a SyntaxError exception. Note that eval
     15  // inherits the strictness of its calling context.  
     16 assert.throws(SyntaxError, function() {
     17    eval("\
     18          var o = {};\
     19          with (o) {}\
     20       ");
     21 });
     22 
     23 reportCompare(0, 0);