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

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

Issue 8888006: Make more JS files beter match the coding standard. Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Address review comments Created 9 years 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 | Annotate | Revision Log
« no previous file with comments | « test/mjsunit/debug-sourceinfo.js ('k') | test/mjsunit/debug-step.js » ('j') | 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 30 matching lines...) Expand all
41 41
42 // Build source by putting all lines together 42 // Build source by putting all lines together
43 var source = ''; 43 var source = '';
44 for (var i = 0; i < lines.length; i++) { 44 for (var i = 0; i < lines.length; i++) {
45 source += lines[i]; 45 source += lines[i];
46 } 46 }
47 eval(source); 47 eval(source);
48 48
49 // Flags: --expose-debug-as debug 49 // Flags: --expose-debug-as debug
50 // Get the Debug object exposed from the debug context global object. 50 // Get the Debug object exposed from the debug context global object.
51 Debug = debug.Debug 51 Debug = debug.Debug;
52 52
53 // Get the script object from one of the functions in the source. 53 // Get the script object from one of the functions in the source.
54 var script = Debug.findScript(a); 54 var script = Debug.findScript(a);
55 55
56 // Make sure that the source is as expected. 56 // Make sure that the source is as expected.
57 assertEquals(source, script.source); 57 assertEquals(source, script.source);
58 assertEquals(source, script.sourceSlice().sourceText()); 58 assertEquals(source, script.sourceSlice().sourceText());
59 59
60 // Try all possible line interval slices. 60 // Try all possible line interval slices.
61 for (var slice_size = 0; slice_size < lines.length; slice_size++) { 61 for (var slice_size = 0; slice_size < lines.length; slice_size++) {
62 for (var n = 0; n < lines.length - slice_size; n++) { 62 for (var n = 0; n < lines.length - slice_size; n++) {
63 var slice = script.sourceSlice(n, n + slice_size); 63 var slice = script.sourceSlice(n, n + slice_size);
64 assertEquals(n, slice.from_line); 64 assertEquals(n, slice.from_line);
65 assertEquals(n + slice_size, slice.to_line); 65 assertEquals(n + slice_size, slice.to_line);
66 66
67 var text = slice.sourceText(); 67 var text = slice.sourceText();
68 var expected = ''; 68 var expected = '';
69 for (var i = 0; i < slice_size; i++) { 69 for (var i = 0; i < slice_size; i++) {
70 expected += lines[n + i]; 70 expected += lines[n + i];
71 } 71 }
72 assertEquals(expected, text); 72 assertEquals(expected, text);
73 } 73 }
74 } 74 }
OLDNEW
« no previous file with comments | « test/mjsunit/debug-sourceinfo.js ('k') | test/mjsunit/debug-step.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698