Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(475)

Side by Side Diff: test/mjsunit/debug-script.js

Issue 1128113006: Add the concept of a V8 extras exports object (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Was mising test-extra.js :( Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « test/cctest/test-extra.js ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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');
OLDNEW
« no previous file with comments | « test/cctest/test-extra.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698