js/src/tests/ecma/Expressions/11.2.2-6-n.js

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

mercurial