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

Unified Diff: src/builtins/builtins-error.cc

Issue 2177183002: Make stack property collected by captureStackTrace non-enumerable and -writable. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | test/mjsunit/stack-traces.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/builtins/builtins-error.cc
diff --git a/src/builtins/builtins-error.cc b/src/builtins/builtins-error.cc
index 25cd9a29e46326bd536f223520ff29f2a67c87c0..aab17b0ba51d27d4255c4e966f0fc99ebbe70c4c 100644
--- a/src/builtins/builtins-error.cc
+++ b/src/builtins/builtins-error.cc
@@ -50,11 +50,15 @@ BUILTIN(ErrorCaptureStackTrace) {
isolate, formatted_stack_trace,
FormatStackTrace(isolate, object, stack_trace));
- RETURN_FAILURE_ON_EXCEPTION(
- isolate, JSObject::SetProperty(object, isolate->factory()->stack_string(),
- formatted_stack_trace, STRICT));
-
- return *isolate->factory()->undefined_value();
+ PropertyDescriptor desc;
+ desc.set_configurable(true);
+ desc.set_value(formatted_stack_trace);
+ Maybe<bool> status = JSReceiver::DefineOwnProperty(
+ isolate, object, isolate->factory()->stack_string(), &desc,
+ Object::THROW_ON_ERROR);
+ if (!status.IsJust()) return isolate->heap()->exception();
+ CHECK(status.FromJust());
+ return isolate->heap()->undefined_value();
}
namespace {
« no previous file with comments | « no previous file | test/mjsunit/stack-traces.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698