|
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 * Arguments : (ArgumentList : ArgumentList, AssignmentExpression) |
|
6 * |
|
7 * @path ch11/11.2/11.2.4/S11.2.4_A1.4_T4.js |
|
8 * @description Return an internal list whose length is one greater than the |
|
9 * length of ArgumentList and whose items are the items of ArgumentList, in order, |
|
10 * followed at the end by GetValue(AssignmentExpression), which is the last item of |
|
11 * the new list |
|
12 */ |
|
13 |
|
14 var x = function () { throw "x"; }; |
|
15 var y = function () { throw "y"; }; |
|
16 |
|
17 function f_arg() { |
|
18 } |
|
19 |
|
20 //CHECK#1 |
|
21 try { |
|
22 f_arg(x(),y()); |
|
23 $ERROR('#1.1: var x = { valueOf: function () { throw "x"; } }; var y = { valueOf: function () { throw "y"; } }; function f_arg() {} f_arg(x(),y()) throw "x". Actual: ' + (f_arg(x(),y()))); |
|
24 } |
|
25 catch (e) { |
|
26 if (e === "y") { |
|
27 $ERROR('#1.2: First argument is evaluated first, and then second argument'); |
|
28 } else { |
|
29 if (e !== "x") { |
|
30 $ERROR('#1.3: var x = { valueOf: function () { throw "x"; } }; var y = { valueOf: function () { throw "y"; } }; function f_arg() {} f_arg(x(),y()) throw "x". Actual: ' + (e)); |
|
31 } |
|
32 } |
|
33 } |
|
34 |