]>
git.saurik.com Git - apple/javascriptcore.git/blob - tests/mozilla/ecma/Expressions/11.2.3-2-n.js
e5ba65c7e7118b06ee54145744c0ad1aaf035ac5
1 /* The contents of this file are subject to the Netscape Public
2 * License Version 1.1 (the "License"); you may not use this file
3 * except in compliance with the License. You may obtain a copy of
4 * the License at http://www.mozilla.org/NPL/
6 * Software distributed under the License is distributed on an "AS
7 * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
8 * implied. See the License for the specific language governing
9 * rights and limitations under the License.
11 * The Original Code is Mozilla Communicator client code, released March
14 * The Initial Developer of the Original Code is Netscape Communications
15 * Corporation. Portions created by Netscape are
16 * Copyright (C) 1998 Netscape Communications Corporation. All
23 File Name: 11.2.3-2-n.js
24 ECMA Section: 11.2.3. Function Calls
27 The production CallExpression : MemberExpression Arguments is evaluated as
30 1.Evaluate MemberExpression.
31 2.Evaluate Arguments, producing an internal list of argument values
33 3.Call GetValue(Result(1)).
34 4.If Type(Result(3)) is not Object, generate a runtime error.
35 5.If Result(3) does not implement the internal [[Call]] method, generate a
37 6.If Type(Result(1)) is Reference, Result(6) is GetBase(Result(1)). Otherwise,
39 7.If Result(6) is an activation object, Result(7) is null. Otherwise, Result(7) is
40 the same as Result(6).
41 8.Call the [[Call]] method on Result(3), providing Result(7) as the this value
42 and providing the list Result(2) as the argument values.
45 The production CallExpression : CallExpression Arguments is evaluated in
46 exactly the same manner, except that the contained CallExpression is
49 Note: Result(8) will never be of type Reference if Result(3) is a native
50 ECMAScript object. Whether calling a host object can return a value of
51 type Reference is implementation-dependent.
53 Author: christine@netscape.com
54 Date: 12 november 1997
57 var SECTION
= "11.2.3-2-n.js";
58 var VERSION
= "ECMA_1";
60 var TITLE
= "Function Calls";
62 writeHeaderToLog( SECTION
+ " "+ TITLE
);
64 var testcases
= new Array();
66 testcases
[tc
++] = new TestCase( SECTION
,
71 testcases
[tc
++] = new TestCase( SECTION
,
79 for ( tc
=0; tc
< testcases
.length
; tc
++ ) {
80 testcases
[tc
].passed
= writeTestCaseResult(
83 testcases
[tc
].description
+" = "+
84 testcases
[tc
].actual
);
86 testcases
[tc
].reason
+= ( testcases
[tc
].passed
) ? "" : "wrong value ";