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

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

Issue 11971015: Skip stack trace formatting in case the global object is already dead. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: fix leaks in the setter. Created 7 years, 11 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 | « test/mjsunit/mjsunit.status ('k') | test/mjsunit/unbox-double-arrays.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/stack-traces-overflow.js
diff --git a/test/mjsunit/stack-traces-overflow.js b/test/mjsunit/stack-traces-overflow.js
index 7722e93bd26129f91c2dae44b8294fbb76806c19..b44bfcd8ae6defcf832202bc00cf432acd7b6071 100644
--- a/test/mjsunit/stack-traces-overflow.js
+++ b/test/mjsunit/stack-traces-overflow.js
@@ -57,6 +57,13 @@ try {
}
+function assertStackAccessors(error_object, type) {
+ assertSame(type,
+ typeof Object.getOwnPropertyDescriptor(error_object, "stack").get);
+ assertSame(type,
+ typeof Object.getOwnPropertyDescriptor(error_object, "stack").set);
+}
+
// Check setting/getting stack property on the prototype chain.
function testErrorPrototype(prototype) {
var object = {};
@@ -64,6 +71,11 @@ function testErrorPrototype(prototype) {
object.stack = "123";
assertEquals("123", object.stack);
assertTrue("123" != prototype.stack);
+ // Check that the accessors on the prototype error object are untouched.
+ assertStackAccessors(prototype, "function");
+ assertEquals("123", Object.getOwnPropertyDescriptor(object, "stack").value);
+ prototype.stack = "abc";
+ assertStackAccessors(prototype, "undefined");
}
try {
« no previous file with comments | « test/mjsunit/mjsunit.status ('k') | test/mjsunit/unbox-double-arrays.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698