| OLD | NEW |
| 1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "src/objects.h" | 5 #include "src/objects.h" |
| 6 | 6 |
| 7 #include <cmath> | 7 #include <cmath> |
| 8 #include <iomanip> | 8 #include <iomanip> |
| 9 #include <sstream> | 9 #include <sstream> |
| 10 | 10 |
| (...skipping 12803 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 12814 SMI_VALUE(ends->get(info->line - 1)) < position); | 12814 SMI_VALUE(ends->get(info->line - 1)) < position); |
| 12815 info->line_start = SMI_VALUE(ends->get(info->line - 1)) + 1; | 12815 info->line_start = SMI_VALUE(ends->get(info->line - 1)) + 1; |
| 12816 info->column = position - info->line_start; | 12816 info->column = position - info->line_start; |
| 12817 } | 12817 } |
| 12818 | 12818 |
| 12819 // Line end is position of the linebreak character. | 12819 // Line end is position of the linebreak character. |
| 12820 info->line_end = SMI_VALUE(ends->get(info->line)); | 12820 info->line_end = SMI_VALUE(ends->get(info->line)); |
| 12821 if (info->line_end > 0) { | 12821 if (info->line_end > 0) { |
| 12822 DCHECK(script->source()->IsString()); | 12822 DCHECK(script->source()->IsString()); |
| 12823 Handle<String> src(String::cast(script->source())); | 12823 Handle<String> src(String::cast(script->source())); |
| 12824 if (src->Get(info->line_end - 1) == '\r') { | 12824 if (src->length() >= info->line_end && |
| 12825 src->Get(info->line_end - 1) == '\r') { |
| 12825 info->line_end--; | 12826 info->line_end--; |
| 12826 } | 12827 } |
| 12827 } | 12828 } |
| 12828 | 12829 |
| 12829 // Add offsets if requested. | 12830 // Add offsets if requested. |
| 12830 if (offset_flag == WITH_OFFSET) { | 12831 if (offset_flag == WITH_OFFSET) { |
| 12831 if (info->line == 0) { | 12832 if (info->line == 0) { |
| 12832 info->column += script->column_offset(); | 12833 info->column += script->column_offset(); |
| 12833 } | 12834 } |
| 12834 info->line += script->line_offset(); | 12835 info->line += script->line_offset(); |
| (...skipping 6163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 18998 | 18999 |
| 18999 Object* data_obj = | 19000 Object* data_obj = |
| 19000 constructor->shared()->get_api_func_data()->access_check_info(); | 19001 constructor->shared()->get_api_func_data()->access_check_info(); |
| 19001 if (data_obj->IsUndefined(isolate)) return nullptr; | 19002 if (data_obj->IsUndefined(isolate)) return nullptr; |
| 19002 | 19003 |
| 19003 return AccessCheckInfo::cast(data_obj); | 19004 return AccessCheckInfo::cast(data_obj); |
| 19004 } | 19005 } |
| 19005 | 19006 |
| 19006 } // namespace internal | 19007 } // namespace internal |
| 19007 } // namespace v8 | 19008 } // namespace v8 |
| OLD | NEW |