tor-browser

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

S13_A4_T2.js (1084B)


      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: |
      6    The production FunctionDeclaration: "function Identifier (
      7    FormalParameterList_opt ) { FunctionBody }" is processed by function
      8    declarations
      9 es5id: 13_A4_T2
     10 description: >
     11    Declaring a function that uses prefix increment operator within
     12    its "return" Expression
     13 ---*/
     14 
     15 function __func(arg){return ++arg;};
     16 
     17 //////////////////////////////////////////////////////////////////////////////
     18 //CHECK#1 
     19 if (typeof __func !== "function") {
     20 throw new Test262Error('#1: typeof __func === "function". Actual: typeof __func ==='+typeof __func);
     21 }
     22 //
     23 //////////////////////////////////////////////////////////////////////////////
     24 
     25 //////////////////////////////////////////////////////////////////////////////
     26 //CHECK#2
     27 if (__func(1) !== 2) {
     28 throw new Test262Error('#2: __func(1) === 2. Actual: __func(1) ==='+__func(1));
     29 }
     30 //
     31 //////////////////////////////////////////////////////////////////////////////
     32 
     33 reportCompare(0, 0);