tor-browser

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

S11.2.2_A2.js (811B)


      1 // Copyright 2009 the Sputnik authors.  All rights reserved.
      2 // This code is governed by the BSD license found in the LICENSE file.
      3 
      4 /*---
      5 info: Operator "new" uses GetValue
      6 es5id: 11.2.2_A2
      7 description: >
      8    If GetBase(NewExpression) or GetBase(MemberExpression) is null,
      9    throw ReferenceError
     10 ---*/
     11 
     12 //CHECK#1
     13 try {
     14  new x;
     15  throw new Test262Error('#1.1: new x throw ReferenceError. Actual: ' + (new x));  
     16 }
     17 catch (e) {
     18  if ((e instanceof ReferenceError) !== true) {
     19    throw new Test262Error('#1.2: new x throw ReferenceError. Actual: ' + (e));  
     20  }
     21 }
     22 
     23 //CHECK#2
     24 try {
     25  new x();
     26  throw new Test262Error('#2: new x() throw ReferenceError'); 
     27 }
     28 catch (e) {
     29  if ((e instanceof ReferenceError) !== true) {
     30    throw new Test262Error('#2: new x() throw ReferenceError'); 
     31  }
     32 }
     33 
     34 reportCompare(0, 0);