1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/js/src/tests/js1_3/regress/delete-001.js Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,49 @@ 1.4 +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 1.5 +/* This Source Code Form is subject to the terms of the Mozilla Public 1.6 + * License, v. 2.0. If a copy of the MPL was not distributed with this 1.7 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 1.8 + 1.9 + 1.10 +/** 1.11 + File Name: delete-001.js 1.12 + Section: regress 1.13 + Description: 1.14 + 1.15 + Regression test for 1.16 + http://scopus.mcom.com/bugsplat/show_bug.cgi?id=108736 1.17 + 1.18 + Author: christine@netscape.com 1.19 + Date: 12 november 1997 1.20 +*/ 1.21 + 1.22 +var SECTION = "JS1_2"; 1.23 +var VERSION = "JS1_2"; 1.24 +var TITLE = "The variable statement"; 1.25 + 1.26 +startTest(); 1.27 +writeHeaderToLog( SECTION + " "+ TITLE); 1.28 + 1.29 +// delete all properties of the global object 1.30 +// per ecma, this does not affect variables in the global object declared 1.31 +// with var or functions 1.32 + 1.33 +for ( p in this ) { 1.34 + delete p; 1.35 +} 1.36 + 1.37 +var result =""; 1.38 + 1.39 +for ( p in this ) { 1.40 + result += String( p ); 1.41 +} 1.42 + 1.43 +// not too picky here... just want to make sure we didn't crash or something 1.44 + 1.45 +new TestCase( SECTION, 1.46 + "delete all properties of the global object", 1.47 + "PASSED", 1.48 + result == "" ? "FAILED" : "PASSED" ); 1.49 + 1.50 + 1.51 +test(); 1.52 +