|
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 |
|
7 /** |
|
8 * File Name: regress-7224.js |
|
9 * Reference: js1_2 |
|
10 * Description: Remove support for the arg |
|
11 * Author: ** replace with your e-mail address ** |
|
12 */ |
|
13 |
|
14 var SECTION = "regress"; // provide a document reference (ie, ECMA section) |
|
15 var VERSION = "JS1_4"; // Version of JavaScript or ECMA |
|
16 var TITLE = "Regression test for bugzilla #7224"; // Provide ECMA section title or a description |
|
17 var BUGNUMBER = "http://bugzilla.mozilla.org/show_bug.cgi?id=7224"; // Provide URL to bugsplat or bugzilla report |
|
18 |
|
19 startTest(); // leave this alone |
|
20 |
|
21 /* |
|
22 * Calls to AddTestCase here. AddTestCase is a function that is defined |
|
23 * in shell.js and takes three arguments: |
|
24 * - a string representation of what is being tested |
|
25 * - the expected result |
|
26 * - the actual result |
|
27 * |
|
28 * For example, a test might look like this: |
|
29 * |
|
30 * var zip = /[\d]{5}$/; |
|
31 * |
|
32 * AddTestCase( |
|
33 * "zip = /[\d]{5}$/; \"PO Box 12345 Boston, MA 02134\".match(zip)", // description of the test |
|
34 * "02134", // expected result |
|
35 * "PO Box 12345 Boston, MA 02134".match(zip) ); // actual result |
|
36 * |
|
37 */ |
|
38 |
|
39 var f = new Function( "return arguments.caller" ); |
|
40 var o = {}; |
|
41 |
|
42 o.foo = f; |
|
43 o.foo("a", "b", "c"); |
|
44 |
|
45 |
|
46 AddTestCase( |
|
47 "var f = new Function( 'return arguments.caller' ); f()", |
|
48 undefined, |
|
49 f() ); |
|
50 |
|
51 AddTestCase( |
|
52 "var o = {}; o.foo = f; o.foo('a')", |
|
53 undefined, |
|
54 o.foo('a') ); |
|
55 |
|
56 test(); // leave this alone. this executes the test cases and |
|
57 // displays results. |