Debian Codegraph @

rhino/testsrc/tests/ecma/Expressions/11.2.2-6-n.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 = '11.2.2-6-n.js';
7
8 /**
9 File Name: 11.2.2-6-n.js
10 ECMA Section: 11.2.2. The new operator
11 Description:
12
13 MemberExpression:
14 PrimaryExpression
15 MemberExpression[Expression]
16 MemberExpression.Identifier
17 new MemberExpression Arguments
18
19 new NewExpression
20
21 The production NewExpression : new NewExpression is evaluated as follows:
22
23 1. Evaluate NewExpression.
24 2. Call GetValue(Result(1)).
25 3. If Type(Result(2)) is not Object, generate a runtime error.
26 4. If Result(2) does not implement the internal [[Construct]] method,
27 generate a runtime error.
28 5. Call the [[Construct]] method on Result(2), providing no arguments
29 (that is, an empty list of arguments).
30 6. If Type(Result(5)) is not Object, generate a runtime error.
31 7. Return Result(5).
32
33 The production MemberExpression : new MemberExpression Arguments is evaluated as follows:
34
35 1. Evaluate MemberExpression.
36 2. Call GetValue(Result(1)).
37 3. Evaluate Arguments, producing an internal list of argument values
38 (section 0).
39 4. If Type(Result(2)) is not Object, generate a runtime error.
40 5. If Result(2) does not implement the internal [[Construct]] method,
41 generate a runtime error.
42 6. Call the [[Construct]] method on Result(2), providing the list
43 Result(3) as the argument values.
44 7. If Type(Result(6)) is not Object, generate a runtime error.
45 8 .Return Result(6).
46
47 Author: [email protected]
48 Date: 12 november 1997
49 */
50 var SECTION = "11.2.2-6-n.js";
51 var VERSION = "ECMA_1";
52 startTest();
53 var TITLE = "The new operator";
54
55 writeHeaderToLog( SECTION + " "+ TITLE);
56
57 var BOOLEAN = true;
58 DESCRIPTION = "BOOLEAN = true; var b = new BOOLEAN()";
59 EXPECTED = "error";
60
61 new TestCase( SECTION,
62 "BOOLEAN = true; var b = new BOOLEAN()",
63 "error",
64 eval("b = new BOOLEAN()") );
65 test();
66
67 function TestFunction() {
68 return arguments;
69 }
70