js/src/tests/test262/ch10/10.2/10.2.1/S10.2.1_A2.js

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

     1 // Copyright 2009 the Sputnik authors.  All rights reserved.
     2 // This code is governed by the BSD license found in the LICENSE file.
     4 /**
     5  * If two or more formal parameters share the same name, hence
     6  * the same property, the corresponding property is given the value that was
     7  * supplied for the last parameter with this name
     8  *
     9  * @path ch10/10.2/10.2.1/S10.2.1_A2.js
    10  * @description Creating functions initialized with two or more formal parameters, which have the same name
    11  * @noStrict
    12  */
    14 //CHECK#1
    15 function f1(x, x) {
    16   return x;
    17 }
    18 if(!(f1(1, 2) === 2)) {
    19   $ERROR("#1: f1(1, 2) === 2");
    20 }
    22 //CHECK#2
    23 function f2(x, x, x){
    24   return x*x*x;
    25 }
    26 if(!(f2(1, 2, 3) === 27)){
    27   $ERROR("f2(1, 2, 3) === 27");
    28 }
    30 //CHECK#3
    31 function f3(x, x) {
    32   return 'a' + x;
    33 }
    34 if(!(f3(1, 2) === 'a2')){
    35   $ERROR("#3: f3(1, 2) === 'a2'");
    36 }

mercurial