| 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 42 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 53   } else if (scripts[i].type == Debug.ScriptType.Extension) { | 53   } else if (scripts[i].type == Debug.ScriptType.Extension) { | 
| 54     extension_count++; | 54     extension_count++; | 
| 55   } else if (scripts[i].type == Debug.ScriptType.Normal) { | 55   } else if (scripts[i].type == Debug.ScriptType.Normal) { | 
| 56     normal_count++; | 56     normal_count++; | 
| 57   } else { | 57   } else { | 
| 58     assertUnreachable('Unexpected type ' + scripts[i].type); | 58     assertUnreachable('Unexpected type ' + scripts[i].type); | 
| 59   } | 59   } | 
| 60 } | 60 } | 
| 61 | 61 | 
| 62 // This has to be updated if the number of native scripts change. | 62 // This has to be updated if the number of native scripts change. | 
| 63 assertEquals(14, named_native_count); | 63 assertEquals(16, named_native_count); | 
| 64 // If no snapshot is used, only the 'gc' extension is loaded. | 64 // If no snapshot is used, only the 'gc' extension is loaded. | 
| 65 // If snapshot is used, all extensions are cached in the snapshot. | 65 // If snapshot is used, all extensions are cached in the snapshot. | 
| 66 assertTrue(extension_count == 1 || extension_count == 5); | 66 assertTrue(extension_count == 1 || extension_count == 5); | 
| 67 // This script and mjsunit.js has been loaded.  If using d8, d8 loads | 67 // This script and mjsunit.js has been loaded.  If using d8, d8 loads | 
| 68 // a normal script during startup too. | 68 // a normal script during startup too. | 
| 69 assertTrue(normal_count == 2 || normal_count == 3); | 69 assertTrue(normal_count == 2 || normal_count == 3); | 
| 70 | 70 | 
| 71 // Test a builtins script. | 71 // Test a builtins script. | 
| 72 var math_script = Debug.findScript('native math.js'); | 72 var math_script = Debug.findScript('native math.js'); | 
| 73 assertEquals('native math.js', math_script.name); | 73 assertEquals('native math.js', math_script.name); | 
| (...skipping 17 matching lines...) Expand all  Loading... | 
| 91 } | 91 } | 
| 92 | 92 | 
| 93 // Test a normal script. | 93 // Test a normal script. | 
| 94 var mjsunit_js_script = Debug.findScript(/mjsunit.js/); | 94 var mjsunit_js_script = Debug.findScript(/mjsunit.js/); | 
| 95 assertTrue(/mjsunit.js/.test(mjsunit_js_script.name)); | 95 assertTrue(/mjsunit.js/.test(mjsunit_js_script.name)); | 
| 96 assertEquals(Debug.ScriptType.Normal, mjsunit_js_script.type); | 96 assertEquals(Debug.ScriptType.Normal, mjsunit_js_script.type); | 
| 97 | 97 | 
| 98 // Check a nonexistent script. | 98 // Check a nonexistent script. | 
| 99 var dummy_script = Debug.findScript('dummy.js'); | 99 var dummy_script = Debug.findScript('dummy.js'); | 
| 100 assertTrue(typeof dummy_script == 'undefined'); | 100 assertTrue(typeof dummy_script == 'undefined'); | 
| OLD | NEW | 
|---|