Debian Codegraph @

rhino/testsrc/tests/ecma/extensions/15.3.2.1-1.js

raw symbols SCIP
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 = '15.3.2.1-1.js';
7
8 /**
9 File Name: 15.3.2.1.js
10 ECMA Section: 15.3.2.1 The Function Constructor
11 new Function(p1, p2, ..., pn, body )
12
13 Description: The last argument specifies the body (executable code)
14 of a function; any preceeding arguments sepcify formal
15 parameters.
16
17 See the text for description of this section.
18
19 This test examples from the specification.
20
21 Author: [email protected]
22 Date: 28 october 1997
23
24 */
25 var SECTION = "15.3.2.1";
26 var VERSION = "ECMA_1";
27 startTest();
28 var TITLE = "The Function Constructor";
29
30 writeHeaderToLog( SECTION + " "+ TITLE);
31
32 var MyObject = new Function( "value", "this.value = value; this.valueOf = new Function( 'return this.value' ); this.toString = new Function( 'return String(this.value);' )" );
33
34 new TestCase( SECTION,
35 "MyObject.__proto__ == Function.prototype",
36 true,
37 MyObject.__proto__ == Function.prototype );
38
39 test();