| OLD | NEW |
| 1 // Copyright 2010 the V8 project authors. All rights reserved. | 1 // Copyright 2010 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 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 111 }; | 111 }; |
| 112 | 112 |
| 113 // Compares 2 strings line-by-line and returns diff in form of array of | 113 // Compares 2 strings line-by-line and returns diff in form of array of |
| 114 // triplets (pos1, pos1_end, pos2_end) describing list of diff chunks. | 114 // triplets (pos1, pos1_end, pos2_end) describing list of diff chunks. |
| 115 static Handle<JSArray> CompareStringsLinewise(Handle<String> s1, | 115 static Handle<JSArray> CompareStringsLinewise(Handle<String> s1, |
| 116 Handle<String> s2); | 116 Handle<String> s2); |
| 117 }; | 117 }; |
| 118 | 118 |
| 119 | 119 |
| 120 // A general-purpose comparator between 2 arrays. | 120 // A general-purpose comparator between 2 arrays. |
| 121 class Compare { | 121 class Comparator { |
| 122 public: | 122 public: |
| 123 | 123 |
| 124 // Holds 2 arrays of some elements allowing to compare any pair of | 124 // Holds 2 arrays of some elements allowing to compare any pair of |
| 125 // element from the first array and element from the second array. | 125 // element from the first array and element from the second array. |
| 126 class Input { | 126 class Input { |
| 127 public: | 127 public: |
| 128 virtual int getLength1() = 0; | 128 virtual int getLength1() = 0; |
| 129 virtual int getLength2() = 0; | 129 virtual int getLength2() = 0; |
| 130 virtual bool equals(int index1, int index2) = 0; | 130 virtual bool equals(int index1, int index2) = 0; |
| 131 | 131 |
| (...skipping 16 matching lines...) Expand all Loading... |
| 148 static void CalculateDifference(Input* input, | 148 static void CalculateDifference(Input* input, |
| 149 Output* result_writer); | 149 Output* result_writer); |
| 150 }; | 150 }; |
| 151 | 151 |
| 152 #endif // ENABLE_DEBUGGER_SUPPORT | 152 #endif // ENABLE_DEBUGGER_SUPPORT |
| 153 | 153 |
| 154 | 154 |
| 155 } } // namespace v8::internal | 155 } } // namespace v8::internal |
| 156 | 156 |
| 157 #endif /* V*_LIVEEDIT_H_ */ | 157 #endif /* V*_LIVEEDIT_H_ */ |
| OLD | NEW |