js/src/tests/test262/ch11/11.2/11.2.4/S11.2.4_A1.4_T4.js

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/js/src/tests/test262/ch11/11.2/11.2.4/S11.2.4_A1.4_T4.js	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,34 @@
     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 + * Arguments : (ArgumentList : ArgumentList, AssignmentExpression)
     1.9 + *
    1.10 + * @path ch11/11.2/11.2.4/S11.2.4_A1.4_T4.js
    1.11 + * @description Return an internal list whose length is one greater than the
    1.12 + * length of ArgumentList and whose items are the items of ArgumentList, in order,
    1.13 + * followed at the end by GetValue(AssignmentExpression), which is the last item of
    1.14 + * the new list
    1.15 + */
    1.16 +
    1.17 +var x = function () { throw "x"; };
    1.18 +var y = function () { throw "y"; };
    1.19 +
    1.20 +function f_arg() {
    1.21 +}
    1.22 +
    1.23 +//CHECK#1
    1.24 +try {
    1.25 +  f_arg(x(),y());
    1.26 +  $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())));  
    1.27 +}
    1.28 +catch (e) {
    1.29 +  if (e === "y") {
    1.30 +     $ERROR('#1.2: First argument is evaluated first, and then second argument');
    1.31 +   } else {
    1.32 +     if (e !== "x") {
    1.33 +       $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));
    1.34 +     }
    1.35 +   }
    1.36 +}
    1.37 +

mercurial