js/src/tests/js1_4/Regress/regress-7224.js

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/js/src/tests/js1_4/Regress/regress-7224.js	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,57 @@
     1.4 +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
     1.5 +/* This Source Code Form is subject to the terms of the Mozilla Public
     1.6 + * License, v. 2.0. If a copy of the MPL was not distributed with this
     1.7 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     1.8 +
     1.9 +
    1.10 +/**
    1.11 + *  File Name:          regress-7224.js
    1.12 + *  Reference:          js1_2
    1.13 + *  Description:        Remove support for the arg
    1.14 + *  Author:             ** replace with your e-mail address **
    1.15 + */
    1.16 +
    1.17 +var SECTION = "regress";       // provide a document reference (ie, ECMA section)
    1.18 +var VERSION = "JS1_4"; // Version of JavaScript or ECMA
    1.19 +var TITLE   = "Regression test for bugzilla #7224";       // Provide ECMA section title or a description
    1.20 +var BUGNUMBER = "http://bugzilla.mozilla.org/show_bug.cgi?id=7224";     // Provide URL to bugsplat or bugzilla report
    1.21 +
    1.22 +startTest();               // leave this alone
    1.23 +
    1.24 +/*
    1.25 + * Calls to AddTestCase here. AddTestCase is a function that is defined
    1.26 + * in shell.js and takes three arguments:
    1.27 + * - a string representation of what is being tested
    1.28 + * - the expected result
    1.29 + * - the actual result
    1.30 + *
    1.31 + * For example, a test might look like this:
    1.32 + *
    1.33 + * var zip = /[\d]{5}$/;
    1.34 + *
    1.35 + * AddTestCase(
    1.36 + * "zip = /[\d]{5}$/; \"PO Box 12345 Boston, MA 02134\".match(zip)",   // description of the test
    1.37 + *  "02134",                                                           // expected result
    1.38 + *  "PO Box 12345 Boston, MA 02134".match(zip) );                      // actual result
    1.39 + *
    1.40 + */
    1.41 +
    1.42 +var f = new Function( "return arguments.caller" );
    1.43 +var o = {};
    1.44 +
    1.45 +o.foo = f;
    1.46 +o.foo("a", "b", "c");
    1.47 +
    1.48 +
    1.49 +AddTestCase(
    1.50 +  "var f = new Function( 'return arguments.caller' ); f()",
    1.51 +  undefined,
    1.52 +  f() );
    1.53 +
    1.54 +AddTestCase(
    1.55 +  "var o = {}; o.foo = f; o.foo('a')",
    1.56 +  undefined,
    1.57 +  o.foo('a') );
    1.58 +
    1.59 +test();       // leave this alone.  this executes the test cases and
    1.60 +// displays results.

mercurial