]> git.saurik.com Git - apple/javascriptcore.git/blob - tests/mozilla/ecma_2/Exceptions/global-001.js
JavaScriptCore-7601.1.46.3.tar.gz
[apple/javascriptcore.git] / tests / mozilla / ecma_2 / Exceptions / global-001.js
1 /**
2 File Name: global-001
3 Corresponds To: ecma/GlobalObject/15.1-1-n.js
4 ECMA Section: The global object
5 Description:
6
7 The global object does not have a [[Construct]] property; it is not
8 possible to use the global object as a constructor with the new operator.
9
10
11 Author: christine@netscape.com
12 Date: 12 november 1997
13 */
14 var SECTION = "global-001";
15 var VERSION = "ECMA_1";
16 var TITLE = "The Global Object";
17
18 startTest();
19 writeHeaderToLog( SECTION + " "+ TITLE);
20
21 var tc = 0;
22 var testcases = new Array();
23
24
25 var result = "Failed";
26 var exception = "No exception thrown";
27 var expect = "Passed";
28
29 try {
30 result = new this();
31 } catch ( e ) {
32 result = expect;
33 exception = e.toString();
34 }
35
36 testcases[tc++] = new TestCase(
37 SECTION,
38 "result = new this()" +
39 " (threw " + exception +")",
40 expect,
41 result );
42
43 test();