Commit 49ae3081 authored by yangguo@chromium.org's avatar yangguo@chromium.org

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
parent ef734e26
...@@ -1144,7 +1144,8 @@ var StackTraceSetter = function(v) { ...@@ -1144,7 +1144,8 @@ var StackTraceSetter = function(v) {
var captureStackTrace = function captureStackTrace(obj, cons_opt) { var captureStackTrace = function captureStackTrace(obj, cons_opt) {
// Define accessors first, as this may fail and throw. // Define accessors first, as this may fail and throw.
ObjectDefineProperty(obj, 'stack', { get: StackTraceGetter, ObjectDefineProperty(obj, 'stack', { get: StackTraceGetter,
set: StackTraceSetter}); set: StackTraceSetter,
configurable: true });
%CollectStackTrace(obj, cons_opt ? cons_opt : captureStackTrace); %CollectStackTrace(obj, cons_opt ? cons_opt : captureStackTrace);
} }
......
// 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);
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment