Debian Codegraph @

rhino/testsrc/tests/js1_5/Regress/regress-504078.js

raw symbols SCIP
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 var gTestfile = 'regress-504078.js';
7 //-----------------------------------------------------------------------------
8 var BUGNUMBER = 504078;
9 var summary = 'Iterations over global object';
10 var actual = '';
11 var expect = '';
12
13 var g = (typeof window == 'undefined' ? this : window);
14
15 //-----------------------------------------------------------------------------
16 test();
17 //-----------------------------------------------------------------------------
18
19 function test()
20 {
21 enterFunc ('test');
22 printBugNumber(BUGNUMBER);
23 printStatus (summary);
24
25 function keys(obj) {
26 for (var prop in obj) {
27 }
28 }
29
30 var data = { a : 1, b : 2 };
31 var data2 = { a : 1, b : 2 };
32
33 function boot() {
34 keys(data);
35 keys(g);
36 keys(data2); // this call dies with "var prop is not a function"
37 print('no error');
38 }
39
40 try
41 {
42 boot();
43 }
44 catch(ex)
45 {
46 actual = ex + '';
47 }
48
49 reportCompare(expect, actual, summary);
50
51 exitFunc ('test');
52 }