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

Side by Side Diff: src/builtins/builtins-error.cc

Issue 2190313002: Set Error.stack property writable (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: More test cases Created 4 years, 4 months 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 | test/mjsunit/regress/regress-5245.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 2016 the V8 project authors. All rights reserved. 1 // Copyright 2016 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/builtins/builtins.h" 5 #include "src/builtins/builtins.h"
6 #include "src/builtins/builtins-utils.h" 6 #include "src/builtins/builtins-utils.h"
7 7
8 #include "src/bootstrapper.h" 8 #include "src/bootstrapper.h"
9 #include "src/messages.h" 9 #include "src/messages.h"
10 #include "src/property-descriptor.h" 10 #include "src/property-descriptor.h"
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
46 isolate->CaptureSimpleStackTrace(object, mode, caller); 46 isolate->CaptureSimpleStackTrace(object, mode, caller);
47 if (!stack_trace->IsJSArray()) return *isolate->factory()->undefined_value(); 47 if (!stack_trace->IsJSArray()) return *isolate->factory()->undefined_value();
48 48
49 Handle<Object> formatted_stack_trace; 49 Handle<Object> formatted_stack_trace;
50 ASSIGN_RETURN_FAILURE_ON_EXCEPTION( 50 ASSIGN_RETURN_FAILURE_ON_EXCEPTION(
51 isolate, formatted_stack_trace, 51 isolate, formatted_stack_trace,
52 FormatStackTrace(isolate, object, stack_trace)); 52 FormatStackTrace(isolate, object, stack_trace));
53 53
54 PropertyDescriptor desc; 54 PropertyDescriptor desc;
55 desc.set_configurable(true); 55 desc.set_configurable(true);
56 desc.set_writable(true);
56 desc.set_value(formatted_stack_trace); 57 desc.set_value(formatted_stack_trace);
57 Maybe<bool> status = JSReceiver::DefineOwnProperty( 58 Maybe<bool> status = JSReceiver::DefineOwnProperty(
58 isolate, object, isolate->factory()->stack_string(), &desc, 59 isolate, object, isolate->factory()->stack_string(), &desc,
59 Object::THROW_ON_ERROR); 60 Object::THROW_ON_ERROR);
60 if (!status.IsJust()) return isolate->heap()->exception(); 61 if (!status.IsJust()) return isolate->heap()->exception();
61 CHECK(status.FromJust()); 62 CHECK(status.FromJust());
62 return isolate->heap()->undefined_value(); 63 return isolate->heap()->undefined_value();
63 } 64 }
64 65
65 namespace { 66 namespace {
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
122 // the code unit 0x0020 (SPACE), and msg. 123 // the code unit 0x0020 (SPACE), and msg.
123 IncrementalStringBuilder builder(isolate); 124 IncrementalStringBuilder builder(isolate);
124 builder.AppendString(name); 125 builder.AppendString(name);
125 builder.AppendCString(": "); 126 builder.AppendCString(": ");
126 builder.AppendString(msg); 127 builder.AppendString(msg);
127 RETURN_RESULT_OR_FAILURE(isolate, builder.Finish()); 128 RETURN_RESULT_OR_FAILURE(isolate, builder.Finish());
128 } 129 }
129 130
130 } // namespace internal 131 } // namespace internal
131 } // namespace v8 132 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | test/mjsunit/regress/regress-5245.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698