]> git.saurik.com Git - apple/javascriptcore.git/blob - tests/mozilla/js1_5/Regress/regress-68498-001.js
JavaScriptCore-7601.1.46.3.tar.gz
[apple/javascriptcore.git] / tests / mozilla / js1_5 / Regress / regress-68498-001.js
1 /*
2 * The contents of this file are subject to the Netscape Public
3 * License Version 1.1 (the "License"); you may not use this file
4 * except in compliance with the License. You may obtain a copy of
5 * the License at http://www.mozilla.org/NPL/
6 *
7 * Software distributed under the License is distributed on an "AS
8 * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
9 * implied. See the License for the specific language governing
10 * rights and limitations under the License.
11 *
12 * The Original Code is mozilla.org code.
13 *
14 * The Initial Developer of the Original Code is Netscape
15 * Communications Corporation. Portions created by Netscape are
16 * Copyright (C) 1998 Netscape Communications Corporation. All
17 * Rights Reserved.
18 *
19 * Contributor(s): brendan@mozilla.org, pschwartau@netscape.com
20 * Date: 15 Feb 2001
21 *
22 * SUMMARY: var self = global JS object, outside any eval, is DontDelete
23 *
24 * See http://bugzilla.mozilla.org/show_bug.cgi?id=68498
25 * See http://bugzilla.mozilla.org/showattachment.cgi?attach_id=25251
26 *
27 * Brendan:
28 *
29 * "Demonstrate that variable statement outside any eval creates a
30 * DontDelete property of the global object"
31 */
32 //-------------------------------------------------------------------------------------------------
33 var bug = 68498;
34 var summary ='Testing that variable statement outside any eval creates' +
35 ' a DontDelete property of the global object';
36
37
38 // To be pedantic, use a variable named 'self' to capture the global object -
39 var self = this;
40 var actual = (delete self);
41 var expect =false;
42
43
44 //-------------------------------------------------------------------------------------------------
45 test();
46 //-------------------------------------------------------------------------------------------------
47
48
49 function test()
50 {
51 enterFunc ('test');
52 printBugNumber (bug);
53 printStatus (summary);
54 reportCompare(expect, actual, summary);
55 exitFunc ('test');
56 }