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

R=verwaest@chromium.org
BUG=393988
LOG=N

Review URL: https://codereview.chromium.org/396063008

git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@22420 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
This commit is contained in:
yangguo@chromium.org 2014-07-16 07:55:05 +00:00
parent ef734e2686
commit 49ae3081d2
2 changed files with 10 additions and 1 deletions

View File

@ -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);
}

View File

@ -0,0 +1,8 @@
// Copyright 2014 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
var o = {};
Error.captureStackTrace(o);
Object.defineProperty(o, "stack", { value: 1 });
assertEquals(1, o.stack);