michael@0: /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: michael@0: /** michael@0: File Name: 11.2.3-3-n.js michael@0: ECMA Section: 11.2.3. Function Calls michael@0: Description: michael@0: michael@0: The production CallExpression : MemberExpression Arguments is evaluated as michael@0: follows: michael@0: michael@0: 1.Evaluate MemberExpression. michael@0: 2.Evaluate Arguments, producing an internal list of argument values michael@0: (section 0). michael@0: 3.Call GetValue(Result(1)). michael@0: 4.If Type(Result(3)) is not Object, generate a runtime error. michael@0: 5.If Result(3) does not implement the internal [[Call]] method, generate a michael@0: runtime error. michael@0: 6.If Type(Result(1)) is Reference, Result(6) is GetBase(Result(1)). Otherwise, michael@0: Result(6) is null. michael@0: 7.If Result(6) is an activation object, Result(7) is null. Otherwise, Result(7) is michael@0: the same as Result(6). michael@0: 8.Call the [[Call]] method on Result(3), providing Result(7) as the this value michael@0: and providing the list Result(2) as the argument values. michael@0: 9.Return Result(8). michael@0: michael@0: The production CallExpression : CallExpression Arguments is evaluated in michael@0: exactly the same manner, except that the contained CallExpression is michael@0: evaluated in step 1. michael@0: michael@0: Note: Result(8) will never be of type Reference if Result(3) is a native michael@0: ECMAScript object. Whether calling a host object can return a value of michael@0: type Reference is implementation-dependent. michael@0: michael@0: Author: christine@netscape.com michael@0: Date: 12 november 1997 michael@0: */ michael@0: michael@0: var SECTION = "11.2.3-3-n.js"; michael@0: var VERSION = "ECMA_1"; michael@0: startTest(); michael@0: var TITLE = "Function Calls"; michael@0: michael@0: writeHeaderToLog( SECTION + " "+ TITLE); michael@0: michael@0: DESCRIPTION = "(void 0).valueOf()"; michael@0: EXPECTED = "error"; michael@0: michael@0: new TestCase( SECTION, michael@0: "(void 0).valueOf()", michael@0: "error", michael@0: eval("(void 0).valueOf()") ); michael@0: test(); michael@0: