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

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

michael@0 1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
michael@0 2 /* This Source Code Form is subject to the terms of the Mozilla Public
michael@0 3 * License, v. 2.0. If a copy of the MPL was not distributed with this
michael@0 4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
michael@0 5
michael@0 6
michael@0 7 /**
michael@0 8 File Name: 11.2.2-9-n.js
michael@0 9 ECMA Section: 11.2.2. The new operator
michael@0 10 Description:
michael@0 11
michael@0 12 MemberExpression:
michael@0 13 PrimaryExpression
michael@0 14 MemberExpression[Expression]
michael@0 15 MemberExpression.Identifier
michael@0 16 new MemberExpression Arguments
michael@0 17
michael@0 18 new NewExpression
michael@0 19
michael@0 20 The production NewExpression : new NewExpression is evaluated as follows:
michael@0 21
michael@0 22 1. Evaluate NewExpression.
michael@0 23 2. Call GetValue(Result(1)).
michael@0 24 3. If Type(Result(2)) is not Object, generate a runtime error.
michael@0 25 4. If Result(2) does not implement the internal [[Construct]] method,
michael@0 26 generate a runtime error.
michael@0 27 5. Call the [[Construct]] method on Result(2), providing no arguments
michael@0 28 (that is, an empty list of arguments).
michael@0 29 6. If Type(Result(5)) is not Object, generate a runtime error.
michael@0 30 7. Return Result(5).
michael@0 31
michael@0 32 The production MemberExpression : new MemberExpression Arguments is evaluated as follows:
michael@0 33
michael@0 34 1. Evaluate MemberExpression.
michael@0 35 2. Call GetValue(Result(1)).
michael@0 36 3. Evaluate Arguments, producing an internal list of argument values
michael@0 37 (section 0).
michael@0 38 4. If Type(Result(2)) is not Object, generate a runtime error.
michael@0 39 5. If Result(2) does not implement the internal [[Construct]] method,
michael@0 40 generate a runtime error.
michael@0 41 6. Call the [[Construct]] method on Result(2), providing the list
michael@0 42 Result(3) as the argument values.
michael@0 43 7. If Type(Result(6)) is not Object, generate a runtime error.
michael@0 44 8 .Return Result(6).
michael@0 45
michael@0 46 Author: christine@netscape.com
michael@0 47 Date: 12 november 1997
michael@0 48 */
michael@0 49
michael@0 50 var SECTION = "11.2.2-9-n.js";
michael@0 51 var VERSION = "ECMA_1";
michael@0 52 startTest();
michael@0 53 var TITLE = "The new operator";
michael@0 54
michael@0 55 writeHeaderToLog( SECTION + " "+ TITLE);
michael@0 56
michael@0 57 var BOOLEAN = new Boolean();
michael@0 58
michael@0 59 DESCRIPTION = "var BOOLEAN = new Boolean(); var b = new BOOLEAN()";
michael@0 60 EXPECTED = "error";
michael@0 61
michael@0 62 new TestCase( SECTION,
michael@0 63 "var BOOLEAN = new Boolean(); var b = new BOOLEAN()",
michael@0 64 "error",
michael@0 65 eval("b = new BOOLEAN()") );
michael@0 66 test();
michael@0 67
michael@0 68 function TestFunction() {
michael@0 69 return arguments;
michael@0 70 }

mercurial