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: regress-7224.js michael@0: * Reference: js1_2 michael@0: * Description: Remove support for the arg michael@0: * Author: ** replace with your e-mail address ** michael@0: */ michael@0: michael@0: var SECTION = "regress"; // provide a document reference (ie, ECMA section) michael@0: var VERSION = "JS1_4"; // Version of JavaScript or ECMA michael@0: var TITLE = "Regression test for bugzilla #7224"; // Provide ECMA section title or a description michael@0: var BUGNUMBER = "http://bugzilla.mozilla.org/show_bug.cgi?id=7224"; // Provide URL to bugsplat or bugzilla report michael@0: michael@0: startTest(); // leave this alone michael@0: michael@0: /* michael@0: * Calls to AddTestCase here. AddTestCase is a function that is defined michael@0: * in shell.js and takes three arguments: michael@0: * - a string representation of what is being tested michael@0: * - the expected result michael@0: * - the actual result michael@0: * michael@0: * For example, a test might look like this: michael@0: * michael@0: * var zip = /[\d]{5}$/; michael@0: * michael@0: * AddTestCase( michael@0: * "zip = /[\d]{5}$/; \"PO Box 12345 Boston, MA 02134\".match(zip)", // description of the test michael@0: * "02134", // expected result michael@0: * "PO Box 12345 Boston, MA 02134".match(zip) ); // actual result michael@0: * michael@0: */ michael@0: michael@0: var f = new Function( "return arguments.caller" ); michael@0: var o = {}; michael@0: michael@0: o.foo = f; michael@0: o.foo("a", "b", "c"); michael@0: michael@0: michael@0: AddTestCase( michael@0: "var f = new Function( 'return arguments.caller' ); f()", michael@0: undefined, michael@0: f() ); michael@0: michael@0: AddTestCase( michael@0: "var o = {}; o.foo = f; o.foo('a')", michael@0: undefined, michael@0: o.foo('a') ); michael@0: michael@0: test(); // leave this alone. this executes the test cases and michael@0: // displays results.