2 // Copyright (C) 2005, 2006, 2007, 2009, 2010 Free Software
5 // This program is free software; you can redistribute it and/or modify
6 // it under the terms of the GNU General Public License as published by
7 // the Free Software Foundation; either version 3 of the License, or
8 // (at your option) any later version.
10 // This program is distributed in the hope that it will be useful,
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 // GNU General Public License for more details.
15 // You should have received a copy of the GNU General Public License
16 // along with this program; if not, write to the Free Software
17 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
24 callAndRecurse
= function(prop
, name
) {
26 // Don't recurse infinitely.
27 if (prop
== "__proto__") return;
28 if (prop
== "constructor") return;
30 // i is the object, name is its name.
31 name
= name
+ "." + prop
;
34 trace
("testing " + name
+ "(" + typeof(i
) + ")");
36 if (typeof(i
) == "function") {
38 // First call with various arguments.
45 trace
("Trying to construct " + name
);
49 trace
("Object was constructed");
50 ASSetPropFlags
(o
, null, 0, 1);
51 ASSetPropFlags
(o
.__proto__
, null, 0, 1);
53 trace
("Testing " + p
+ "()");
63 o
[p
].call
(null, 1, 2);
64 o
[p
].call
(null, 1, 2, 3);
65 o
[p
].call
(null, 1, 2, 3, 4);
67 // Recurse for own properties only.
68 if (o
.hasOwnProperty
(p
)) {
69 callAndRecurse
(p
, name
);
74 else if (typeof(i
) == "object") {
75 ASSetPropFlags
(i
, null, 0, 1);
77 callAndRecurse
(p
, name
);
86 ASSetPropFlags
(obj
, null, 0, 1);
88 callAndRecurse
(prop
, start
);
91 pass
("Nothing crashed gnash");