| 1 | /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ |
| 2 | /* This Source Code Form is subject to the terms of the Mozilla Public |
| 3 | * License, v. 2.0. If a copy of the MPL was not distributed with this |
| 4 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
| 5 | |
| 6 | gTestfile = 'regress-7224.js'; |
| 7 | |
| 8 | /** |
| 9 | * File Name: regress-7224.js |
| 10 | * Reference: js1_2 |
| 11 | * Description: Remove support for the arg |
| 12 | * Author: ** replace with your e-mail address ** |
| 13 | */ |
| 14 | |
| 15 | var SECTION = "regress"; // provide a document reference (ie, ECMA section) |
| 16 | var VERSION = "JS1_4"; // Version of JavaScript or ECMA |
| 17 | var TITLE = "Regression test for bugzilla #7224"; // Provide ECMA section title or a description |
| 18 | var BUGNUMBER = "http://bugzilla.mozilla.org/show_bug.cgi?id=7224"; // Provide URL to bugsplat or bugzilla report |
| 19 | |
| 20 | startTest(); // leave this alone |
| 21 | |
| 22 | /* |
| 23 | * Calls to AddTestCase here. AddTestCase is a function that is defined |
| 24 | * in shell.js and takes three arguments: |
| 25 | * - a string representation of what is being tested |
| 26 | * - the expected result |
| 27 | * - the actual result |
| 28 | * |
| 29 | * For example, a test might look like this: |
| 30 | * |
| 31 | * var zip = /[\d]{5}$/; |
| 32 | * |
| 33 | * AddTestCase( |
| 34 | * "zip = /[\d]{5}$/; \"PO Box 12345 Boston, MA 02134\".match(zip)", // description of the test |
| 35 | * "02134", // expected result |
| 36 | * "PO Box 12345 Boston, MA 02134".match(zip) ); // actual result |
| 37 | * |
| 38 | */ |
| 39 | |
| 40 | var f = new Function( "return arguments.caller" ); |
| 41 | var o = {}; |
| 42 | |
| 43 | o.foo = f; |
| 44 | o.foo("a", "b", "c"); |
| 45 | |
| 46 | |
| 47 | AddTestCase( |
| 48 | "var f = new Function( 'return arguments.caller' ); f()", |
| 49 | undefined, |
| 50 | f() ); |
| 51 | |
| 52 | AddTestCase( |
| 53 | "var o = {}; o.foo = f; o.foo('a')", |
| 54 | undefined, |
| 55 | o.foo('a') ); |
| 56 | |
| 57 | test(); // leave this alone. this executes the test cases and |
| 58 | // displays results. |