|
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: 10.2.3-2.js |
|
9 ECMA Section: 10.2.3 Function and Anonymous Code |
|
10 Description: |
|
11 |
|
12 The scope chain is initialized to contain the activation object followed |
|
13 by the global object. Variable instantiation is performed using the |
|
14 activation by the global object. Variable instantiation is performed using |
|
15 the activation object as the variable object and using property attributes |
|
16 { DontDelete }. The caller provides the this value. If the this value |
|
17 provided by the caller is not an object (including the case where it is |
|
18 null), then the this value is the global object. |
|
19 |
|
20 Author: christine@netscape.com |
|
21 Date: 12 november 1997 |
|
22 */ |
|
23 |
|
24 var SECTION = "10.2.3-2"; |
|
25 var VERSION = "ECMA_1"; |
|
26 startTest(); |
|
27 var TITLE = "Function and Anonymous Code"; |
|
28 |
|
29 writeHeaderToLog( SECTION + " "+ TITLE); |
|
30 |
|
31 var o = new MyObject("hello"); |
|
32 |
|
33 new TestCase( SECTION, |
|
34 "MyFunction(\"PASSED!\")", |
|
35 "PASSED!", |
|
36 MyFunction("PASSED!") ); |
|
37 |
|
38 var o = MyFunction(); |
|
39 |
|
40 new TestCase( SECTION, |
|
41 "MyOtherFunction(true);", |
|
42 false, |
|
43 MyOtherFunction(true) ); |
|
44 |
|
45 test(); |
|
46 |
|
47 function MyFunction( value ) { |
|
48 var x = value; |
|
49 delete x; |
|
50 return x; |
|
51 } |
|
52 function MyOtherFunction(value) { |
|
53 var x = value; |
|
54 return delete x; |
|
55 } |
|
56 function MyObject( value ) { |
|
57 this.THIS = this; |
|
58 } |