js/src/tests/js1_4/Regress/function-001.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/function-001.js	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,62 @@
     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:          function-001.js
    1.12 + *  Description:
    1.13 + *
    1.14 + * http://scopus.mcom.com/bugsplat/show_bug.cgi?id=325843
    1.15 + * js> function f(a){var a,b;}
    1.16 + *
    1.17 + * causes an an assert on a null 'sprop' in the 'Variables' function in
    1.18 + * jsparse.c This will crash non-debug build.
    1.19 + *
    1.20 + *  Author:             christine@netscape.com
    1.21 + *  Date:               11 August 1998
    1.22 + */
    1.23 +var SECTION = "function-001.js";
    1.24 +var VERSION = "JS1_4";
    1.25 +var TITLE   = "Regression test case for 325843";
    1.26 +var BUGNUMBER="3258435";
    1.27 +startTest();
    1.28 +
    1.29 +writeHeaderToLog( SECTION + " "+ TITLE);
    1.30 +
    1.31 +eval("function f1 (a){ var a,b; }");
    1.32 +
    1.33 +function f2( a ) { var a, b; };
    1.34 +
    1.35 +new TestCase(
    1.36 +  SECTION,
    1.37 +  "eval(\"function f1 (a){ var a,b; }\"); "+
    1.38 +  "function f2( a ) { var a, b; }; typeof f1",
    1.39 +  "function",
    1.40 +  typeof f1 );
    1.41 +
    1.42 +// force a function decompilation
    1.43 +
    1.44 +new TestCase(
    1.45 +  SECTION,
    1.46 +  "typeof f1.toString()",
    1.47 +  "string",
    1.48 +  typeof f1.toString() );
    1.49 +
    1.50 +new TestCase(
    1.51 +  SECTION,
    1.52 +  "typeof f2",
    1.53 +  "function",
    1.54 +  typeof f2 );
    1.55 +
    1.56 +// force a function decompilation
    1.57 +
    1.58 +new TestCase(
    1.59 +  SECTION,
    1.60 +  "typeof f2.toString()",
    1.61 +  "string",
    1.62 +  typeof f2.toString() );
    1.63 +
    1.64 +test();
    1.65 +

mercurial