Reviewers: Toon Verwaest,

Description:
Error.captureStackTrace should define "stack" property as configurable.

[email protected]
BUG=393988
LOG=N

Please review this at https://codereview.chromium.org/396063008/

SVN Base: https://v8.googlecode.com/svn/branches/bleeding_edge

Affected files (+6, -4 lines):
  M src/messages.js
  A + test/mjsunit/regress/regress-crbug-393988.js


Index: src/messages.js
diff --git a/src/messages.js b/src/messages.js
index 28af372b7f2fbc2f1897222e4b9b32eebda4ca57..ee5b1950a7f2bd6155eca93b2a60240cf5c785f4 100644
--- a/src/messages.js
+++ b/src/messages.js
@@ -1144,7 +1144,8 @@ var StackTraceSetter = function(v) {
 var captureStackTrace = function captureStackTrace(obj, cons_opt) {
   // Define accessors first, as this may fail and throw.
   ObjectDefineProperty(obj, 'stack', { get: StackTraceGetter,
-                                       set: StackTraceSetter});
+                                       set: StackTraceSetter,
+                                       configurable: true });
   %CollectStackTrace(obj, cons_opt ? cons_opt : captureStackTrace);
 }

Index: test/mjsunit/regress/regress-crbug-393988.js
diff --git a/test/mjsunit/harmony/regress/regress-3426.js b/test/mjsunit/regress/regress-crbug-393988.js
similarity index 59%
copy from test/mjsunit/harmony/regress/regress-3426.js
copy to test/mjsunit/regress/regress-crbug-393988.js
index c3b11a1792f8c8adaf05788d9604a2c9c9f5dcde..9543e1e4c4aaed07c9a5743500f004ca3c677a10 100644
--- a/test/mjsunit/harmony/regress/regress-3426.js
+++ b/test/mjsunit/regress/regress-crbug-393988.js
@@ -2,6 +2,7 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.

-// Flags: --harmony-scoping
-
-assertThrows("(function() { 'use strict'; { let f; var f; } })", SyntaxError);
+var o = {};
+Error.captureStackTrace(o);
+Object.defineProperty(o, "stack", { value: 1 });
+assertEquals(1, o.stack);


--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
--- You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to