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

Unified Diff: test/mjsunit/stack-traces.js

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 | « src/builtins/builtins-error.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/stack-traces.js
diff --git a/test/mjsunit/stack-traces.js b/test/mjsunit/stack-traces.js
index a30a51548dfc40dbf8207501904f1eb6ef2daef5..914f1ba188d4b6a2da6a51ad43a2c77f556ea2b1 100644
--- a/test/mjsunit/stack-traces.js
+++ b/test/mjsunit/stack-traces.js
@@ -381,6 +381,15 @@ assertEquals(undefined, error.stack);
error = new Error();
Error.captureStackTrace(error);
+// Check property descriptor.
+var o = {};
+Error.captureStackTrace(o);
+assertEquals([], Object.keys(o));
+var desc = Object.getOwnPropertyDescriptor(o, "stack");
+assertFalse(desc.writable);
+assertFalse(desc.enumerable);
+assertTrue(desc.configurable);
+
// Check that exceptions thrown within prepareStackTrace throws an exception.
Error.prepareStackTrace = function(e, frames) { throw 42; }
« no previous file with comments | « src/builtins/builtins-error.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698