js/src/tests/ecma/Expressions/11.2.3-3-n.js

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/js/src/tests/ecma/Expressions/11.2.3-3-n.js	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,57 @@
     1.4 +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
     1.5 +/* This Source Code Form is subject to the terms of the Mozilla Public
     1.6 + * License, v. 2.0. If a copy of the MPL was not distributed with this
     1.7 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     1.8 +
     1.9 +
    1.10 +/**
    1.11 +   File Name:          11.2.3-3-n.js
    1.12 +   ECMA Section:       11.2.3. Function Calls
    1.13 +   Description:
    1.14 +
    1.15 +   The production CallExpression : MemberExpression Arguments is evaluated as
    1.16 +   follows:
    1.17 +
    1.18 +   1.Evaluate MemberExpression.
    1.19 +   2.Evaluate Arguments, producing an internal list of argument values
    1.20 +   (section 0).
    1.21 +   3.Call GetValue(Result(1)).
    1.22 +   4.If Type(Result(3)) is not Object, generate a runtime error.
    1.23 +   5.If Result(3) does not implement the internal [[Call]] method, generate a
    1.24 +   runtime error.
    1.25 +   6.If Type(Result(1)) is Reference, Result(6) is GetBase(Result(1)). Otherwise,
    1.26 +   Result(6) is null.
    1.27 +   7.If Result(6) is an activation object, Result(7) is null. Otherwise, Result(7) is
    1.28 +   the same as Result(6).
    1.29 +   8.Call the [[Call]] method on Result(3), providing Result(7) as the this value
    1.30 +   and providing the list Result(2) as the argument values.
    1.31 +   9.Return Result(8).
    1.32 +
    1.33 +   The production CallExpression : CallExpression Arguments is evaluated in
    1.34 +   exactly the same manner, except that the contained CallExpression is
    1.35 +   evaluated in step 1.
    1.36 +
    1.37 +   Note: Result(8) will never be of type Reference if Result(3) is a native
    1.38 +   ECMAScript object. Whether calling a host object can return a value of
    1.39 +   type Reference is implementation-dependent.
    1.40 +
    1.41 +   Author:             christine@netscape.com
    1.42 +   Date:               12 november 1997
    1.43 +*/
    1.44 +
    1.45 +var SECTION = "11.2.3-3-n.js";
    1.46 +var VERSION = "ECMA_1";
    1.47 +startTest();
    1.48 +var TITLE   = "Function Calls";
    1.49 +
    1.50 +writeHeaderToLog( SECTION + " "+ TITLE);
    1.51 +
    1.52 +DESCRIPTION = "(void 0).valueOf()";
    1.53 +EXPECTED = "error";
    1.54 +
    1.55 +new TestCase( SECTION,
    1.56 +              "(void 0).valueOf()",
    1.57 +              "error",
    1.58 +              eval("(void 0).valueOf()") );
    1.59 +test();
    1.60 +

mercurial