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