| 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 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 59 } else if (scripts[i].type == Debug.ScriptType.Extension) { | 59 } else if (scripts[i].type == Debug.ScriptType.Extension) { |
| 60 extension_count++; | 60 extension_count++; |
| 61 } else if (scripts[i].type == Debug.ScriptType.Normal) { | 61 } else if (scripts[i].type == Debug.ScriptType.Normal) { |
| 62 normal_count++; | 62 normal_count++; |
| 63 } else { | 63 } else { |
| 64 assertUnreachable('Unexpected type ' + scripts[i].type); | 64 assertUnreachable('Unexpected type ' + scripts[i].type); |
| 65 } | 65 } |
| 66 } | 66 } |
| 67 | 67 |
| 68 // This has to be updated if the number of native scripts change. | 68 // This has to be updated if the number of native scripts change. |
| 69 assertEquals(%NativeScriptsCount(), named_native_count); | 69 assertEquals(%NativeScriptsCount() + %NativeExtrasCount(), named_native_count); |
| 70 // Only the 'gc' extension is loaded. | 70 // Only the 'gc' extension is loaded. |
| 71 assertEquals(1, extension_count); | 71 assertEquals(1, extension_count); |
| 72 // This script and mjsunit.js has been loaded. If using d8, d8 loads | 72 // This script and mjsunit.js has been loaded. If using d8, d8 loads |
| 73 // a normal script during startup too. | 73 // a normal script during startup too. |
| 74 assertTrue(normal_count == 2 || normal_count == 3); | 74 assertTrue(normal_count == 2 || normal_count == 3); |
| 75 | 75 |
| 76 // Test a builtins script. | 76 // Test a builtins script. |
| 77 var math_script = Debug.findScript('native math.js'); | 77 var math_script = Debug.findScript('native math.js'); |
| 78 assertEquals('native math.js', math_script.name); | 78 assertEquals('native math.js', math_script.name); |
| 79 assertEquals(Debug.ScriptType.Native, math_script.type); | 79 assertEquals(Debug.ScriptType.Native, math_script.type); |
| (...skipping 16 matching lines...) Expand all Loading... |
| 96 } | 96 } |
| 97 | 97 |
| 98 // Test a normal script. | 98 // Test a normal script. |
| 99 var debug_script = Debug.findScript(/debug-script.js/); | 99 var debug_script = Debug.findScript(/debug-script.js/); |
| 100 assertTrue(/debug-script.js/.test(debug_script.name)); | 100 assertTrue(/debug-script.js/.test(debug_script.name)); |
| 101 assertEquals(Debug.ScriptType.Normal, debug_script.type); | 101 assertEquals(Debug.ScriptType.Normal, debug_script.type); |
| 102 | 102 |
| 103 // Check a nonexistent script. | 103 // Check a nonexistent script. |
| 104 var dummy_script = Debug.findScript('dummy.js'); | 104 var dummy_script = Debug.findScript('dummy.js'); |
| 105 assertTrue(typeof dummy_script == 'undefined'); | 105 assertTrue(typeof dummy_script == 'undefined'); |
| OLD | NEW |