OLD | NEW |
1 // Copyright 2006-2008 the V8 project authors. All rights reserved. | 1 // Copyright 2006-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 298 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
309 var i = (lower + upper) >> 1; | 309 var i = (lower + upper) >> 1; |
310 | 310 |
311 if (position > line_ends[i]) { | 311 if (position > line_ends[i]) { |
312 lower = i + 1; | 312 lower = i + 1; |
313 } else if (position <= line_ends[i - 1]) { | 313 } else if (position <= line_ends[i - 1]) { |
314 upper = i - 1; | 314 upper = i - 1; |
315 } else { | 315 } else { |
316 return i; | 316 return i; |
317 } | 317 } |
318 } | 318 } |
| 319 |
319 return -1; | 320 return -1; |
320 } | 321 } |
321 | 322 |
322 /** | 323 /** |
323 * Get information on a specific source position. | 324 * Get information on a specific source position. |
324 * @param {number} position The source position | 325 * @param {number} position The source position |
325 * @param {boolean} include_resource_offset Set to true to have the resource | 326 * @param {boolean} include_resource_offset Set to true to have the resource |
326 * offset added to the location | 327 * offset added to the location |
327 * @return {SourceLocation} | 328 * @return {SourceLocation} |
328 * If line is negative or not in the source null is returned. | 329 * If line is negative or not in the source null is returned. |
(...skipping 725 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1054 else throw e; | 1055 else throw e; |
1055 } | 1056 } |
1056 } | 1057 } |
1057 | 1058 |
1058 %FunctionSetName(errorToString, 'toString'); | 1059 %FunctionSetName(errorToString, 'toString'); |
1059 %SetProperty($Error.prototype, 'toString', errorToString, DONT_ENUM); | 1060 %SetProperty($Error.prototype, 'toString', errorToString, DONT_ENUM); |
1060 | 1061 |
1061 // Boilerplate for exceptions for stack overflows. Used from | 1062 // Boilerplate for exceptions for stack overflows. Used from |
1062 // Top::StackOverflow(). | 1063 // Top::StackOverflow(). |
1063 const kStackOverflowBoilerplate = MakeRangeError('stack_overflow', []); | 1064 const kStackOverflowBoilerplate = MakeRangeError('stack_overflow', []); |
OLD | NEW |