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

Side by Side Diff: src/api.cc

Issue 1507273002: Make Error.prototype.toString spec compliant; and fix various side-effect-free error printing metho… (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 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
« no previous file with comments | « no previous file | src/ast/scopes.cc » ('j') | src/messages.cc » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 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/api.h" 5 #include "src/api.h"
6 6
7 #include <string.h> // For memcpy, strlen. 7 #include <string.h> // For memcpy, strlen.
8 #ifdef V8_USE_ADDRESS_SANITIZER 8 #ifdef V8_USE_ADDRESS_SANITIZER
9 #include <sanitizer/asan_interface.h> 9 #include <sanitizer/asan_interface.h>
10 #endif // V8_USE_ADDRESS_SANITIZER 10 #endif // V8_USE_ADDRESS_SANITIZER
(...skipping 2880 matching lines...) Expand 10 before | Expand all | Expand 10 after
2891 RETURN_ESCAPED(result); 2891 RETURN_ESCAPED(result);
2892 } 2892 }
2893 2893
2894 2894
2895 Local<String> Value::ToString(Isolate* isolate) const { 2895 Local<String> Value::ToString(Isolate* isolate) const {
2896 RETURN_TO_LOCAL_UNCHECKED(ToString(isolate->GetCurrentContext()), String); 2896 RETURN_TO_LOCAL_UNCHECKED(ToString(isolate->GetCurrentContext()), String);
2897 } 2897 }
2898 2898
2899 2899
2900 MaybeLocal<String> Value::ToDetailString(Local<Context> context) const { 2900 MaybeLocal<String> Value::ToDetailString(Local<Context> context) const {
2901 auto obj = Utils::OpenHandle(this); 2901 i::Handle<i::Object> obj = Utils::OpenHandle(this);
2902 if (obj->IsString()) return ToApiHandle<String>(obj); 2902 if (obj->IsString()) return ToApiHandle<String>(obj);
2903 PREPARE_FOR_EXECUTION(context, "ToDetailString", String); 2903 PREPARE_FOR_EXECUTION(context, "ToDetailString", String);
2904 Local<String> result; 2904 Local<String> result;
2905 has_pending_exception = 2905 i::Handle<i::Object> args[] = {obj};
2906 !ToLocal<String>(i::Execution::ToDetailString(isolate, obj), &result); 2906 has_pending_exception = !ToLocal<String>(
2907 i::Execution::TryCall(isolate, isolate->no_side_effects_to_string_fun(),
2908 isolate->factory()->undefined_value(),
2909 arraysize(args), args),
2910 &result);
2907 RETURN_ON_FAILED_EXECUTION(String); 2911 RETURN_ON_FAILED_EXECUTION(String);
2908 RETURN_ESCAPED(result); 2912 RETURN_ESCAPED(result);
2909 } 2913 }
2910 2914
2911 2915
2912 Local<String> Value::ToDetailString(Isolate* isolate) const { 2916 Local<String> Value::ToDetailString(Isolate* isolate) const {
2913 RETURN_TO_LOCAL_UNCHECKED(ToDetailString(isolate->GetCurrentContext()), 2917 RETURN_TO_LOCAL_UNCHECKED(ToDetailString(isolate->GetCurrentContext()),
2914 String); 2918 String);
2915 } 2919 }
2916 2920
(...skipping 5612 matching lines...) Expand 10 before | Expand all | Expand 10 after
8529 Address callback_address = 8533 Address callback_address =
8530 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); 8534 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback));
8531 VMState<EXTERNAL> state(isolate); 8535 VMState<EXTERNAL> state(isolate);
8532 ExternalCallbackScope call_scope(isolate, callback_address); 8536 ExternalCallbackScope call_scope(isolate, callback_address);
8533 callback(info); 8537 callback(info);
8534 } 8538 }
8535 8539
8536 8540
8537 } // namespace internal 8541 } // namespace internal
8538 } // namespace v8 8542 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | src/ast/scopes.cc » ('j') | src/messages.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698