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:
parent
ef734e2686
commit
49ae3081d2
@ -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);
|
||||
}
|
||||
|
||||
|
8
test/mjsunit/regress/regress-crbug-393988.js
Normal file
8
test/mjsunit/regress/regress-crbug-393988.js
Normal 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);
|
Loading…
Reference in New Issue
Block a user