OLD | NEW |
---|---|
1 // Copyright 2008 the V8 project authors. All rights reserved. | 1 // Copyright 2008 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 23 matching lines...) Expand all Loading... | |
34 | 34 |
35 // Count script types. | 35 // Count script types. |
36 var named_native_count = 0; | 36 var named_native_count = 0; |
37 var extension_count = 0; | 37 var extension_count = 0; |
38 var normal_count = 0; | 38 var normal_count = 0; |
39 var scripts = Debug.scripts(); | 39 var scripts = Debug.scripts(); |
40 for (i = 0; i < scripts.length; i++) { | 40 for (i = 0; i < scripts.length; i++) { |
41 if (scripts[i].type == Debug.ScriptType.Native) { | 41 if (scripts[i].type == Debug.ScriptType.Native) { |
42 if (scripts[i].name) { | 42 if (scripts[i].name) { |
43 named_native_count++; | 43 named_native_count++; |
44 print(scripts[i].name); | |
Vyacheslav Egorov (Chromium)
2011/03/15 09:20:09
please remove
Erik Corry
2011/03/17 13:39:17
Done.
| |
44 } | 45 } |
45 } else if (scripts[i].type == Debug.ScriptType.Extension) { | 46 } else if (scripts[i].type == Debug.ScriptType.Extension) { |
46 extension_count++; | 47 extension_count++; |
47 } else if (scripts[i].type == Debug.ScriptType.Normal) { | 48 } else if (scripts[i].type == Debug.ScriptType.Normal) { |
48 normal_count++; | 49 normal_count++; |
49 } else { | 50 } else { |
50 assertUnreachable('Unexpected type ' + scripts[i].type); | 51 assertUnreachable('Unexpected type ' + scripts[i].type); |
51 } | 52 } |
52 } | 53 } |
53 | 54 |
(...skipping 29 matching lines...) Expand all Loading... | |
83 } | 84 } |
84 | 85 |
85 // Test a normal script. | 86 // Test a normal script. |
86 var mjsunit_js_script = Debug.findScript(/mjsunit.js/); | 87 var mjsunit_js_script = Debug.findScript(/mjsunit.js/); |
87 assertTrue(/mjsunit.js/.test(mjsunit_js_script.name)); | 88 assertTrue(/mjsunit.js/.test(mjsunit_js_script.name)); |
88 assertEquals(Debug.ScriptType.Normal, mjsunit_js_script.type); | 89 assertEquals(Debug.ScriptType.Normal, mjsunit_js_script.type); |
89 | 90 |
90 // Check a nonexistent script. | 91 // Check a nonexistent script. |
91 var dummy_script = Debug.findScript('dummy.js'); | 92 var dummy_script = Debug.findScript('dummy.js'); |
92 assertTrue(typeof dummy_script == 'undefined'); | 93 assertTrue(typeof dummy_script == 'undefined'); |
OLD | NEW |