1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/js/src/tests/test262/ch13/13.0/S13_A4_T4.js Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,46 @@ 1.4 +// Copyright 2009 the Sputnik authors. All rights reserved. 1.5 +// This code is governed by the BSD license found in the LICENSE file. 1.6 + 1.7 +/** 1.8 + * The production FunctionDeclaration: "function Identifier ( FormalParameterList_opt ) { FunctionBody }" is processed by function declarations 1.9 + * 1.10 + * @path ch13/13.0/S13_A4_T4.js 1.11 + * @description Declaring a function that uses strings concatenaion opeator within its "return" Expression 1.12 + */ 1.13 + 1.14 +function __func(){return arguments[0].name + " " + arguments[0].surname;}; 1.15 + 1.16 +////////////////////////////////////////////////////////////////////////////// 1.17 +//CHECK#1 1.18 +if (typeof __func !== "function") { 1.19 + $ERROR('#1: typeof __func === "function". Actual: typeof __func ==='+typeof __func); 1.20 +} 1.21 +// 1.22 +////////////////////////////////////////////////////////////////////////////// 1.23 + 1.24 +////////////////////////////////////////////////////////////////////////////// 1.25 +//CHECK#2 1.26 +if (__func({name:'fox', surname:'malder'}) !== "fox malder") { 1.27 + $ERROR('#2: __func({name:\'fox\', surname:\'malder\'}) === "fox malder". Actual: __func({name:\'fox\', surname:\'malder\'}) ==='+__func({name:'fox', surname:'malder'})); 1.28 +} 1.29 +// 1.30 +////////////////////////////////////////////////////////////////////////////// 1.31 + 1.32 +function func__(arg){return arg.name + " " + arg.surname;}; 1.33 + 1.34 +////////////////////////////////////////////////////////////////////////////// 1.35 +//CHECK#3 1.36 +if (typeof func__ !== "function") { 1.37 + $ERROR('#3: typeof func__ === "function". Actual: typeof __func ==='+typeof __func); 1.38 +} 1.39 +// 1.40 +////////////////////////////////////////////////////////////////////////////// 1.41 + 1.42 +////////////////////////////////////////////////////////////////////////////// 1.43 +//CHECK#4 1.44 +if (func__({name:'john', surname:'lennon'}) !== "john lennon") { 1.45 + $ERROR('#4: func__({name:\'john\', surname:\'lennon\'}) === "john lennon". Actual: __func({name:\'john\', surname:\'lennon\'}) ==='+__func({name:'john', surname:'lennon'})); 1.46 +} 1.47 +// 1.48 +////////////////////////////////////////////////////////////////////////////// 1.49 +