19155e252524a2bf92aecd27493feafed86702312kmillikin@chromium.org// Copyright 2010 the V8 project authors. All rights reserved.
29155e252524a2bf92aecd27493feafed86702312kmillikin@chromium.org// Redistribution and use in source and binary forms, with or without
39155e252524a2bf92aecd27493feafed86702312kmillikin@chromium.org// modification, are permitted provided that the following conditions are
49155e252524a2bf92aecd27493feafed86702312kmillikin@chromium.org// met:
59155e252524a2bf92aecd27493feafed86702312kmillikin@chromium.org//
69155e252524a2bf92aecd27493feafed86702312kmillikin@chromium.org//     * Redistributions of source code must retain the above copyright
79155e252524a2bf92aecd27493feafed86702312kmillikin@chromium.org//       notice, this list of conditions and the following disclaimer.
89155e252524a2bf92aecd27493feafed86702312kmillikin@chromium.org//     * Redistributions in binary form must reproduce the above
99155e252524a2bf92aecd27493feafed86702312kmillikin@chromium.org//       copyright notice, this list of conditions and the following
109155e252524a2bf92aecd27493feafed86702312kmillikin@chromium.org//       disclaimer in the documentation and/or other materials provided
119155e252524a2bf92aecd27493feafed86702312kmillikin@chromium.org//       with the distribution.
129155e252524a2bf92aecd27493feafed86702312kmillikin@chromium.org//     * Neither the name of Google Inc. nor the names of its
139155e252524a2bf92aecd27493feafed86702312kmillikin@chromium.org//       contributors may be used to endorse or promote products derived
149155e252524a2bf92aecd27493feafed86702312kmillikin@chromium.org//       from this software without specific prior written permission.
159155e252524a2bf92aecd27493feafed86702312kmillikin@chromium.org//
169155e252524a2bf92aecd27493feafed86702312kmillikin@chromium.org// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
179155e252524a2bf92aecd27493feafed86702312kmillikin@chromium.org// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
189155e252524a2bf92aecd27493feafed86702312kmillikin@chromium.org// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
199155e252524a2bf92aecd27493feafed86702312kmillikin@chromium.org// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
209155e252524a2bf92aecd27493feafed86702312kmillikin@chromium.org// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
219155e252524a2bf92aecd27493feafed86702312kmillikin@chromium.org// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
229155e252524a2bf92aecd27493feafed86702312kmillikin@chromium.org// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
239155e252524a2bf92aecd27493feafed86702312kmillikin@chromium.org// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
249155e252524a2bf92aecd27493feafed86702312kmillikin@chromium.org// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
259155e252524a2bf92aecd27493feafed86702312kmillikin@chromium.org// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
269155e252524a2bf92aecd27493feafed86702312kmillikin@chromium.org// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
279155e252524a2bf92aecd27493feafed86702312kmillikin@chromium.org
289155e252524a2bf92aecd27493feafed86702312kmillikin@chromium.org// This regression test is used to ensure that Object.defineProperty
299155e252524a2bf92aecd27493feafed86702312kmillikin@chromium.org// keeps the existing value of the writable flag if none is given
301805e21b0aece8c05f4960a5c0751c4463557891fschneider@chromium.org// in the provided descriptor.
319155e252524a2bf92aecd27493feafed86702312kmillikin@chromium.org// See: http://code.google.com/p/v8/issues/detail?id=720
329155e252524a2bf92aecd27493feafed86702312kmillikin@chromium.org
339155e252524a2bf92aecd27493feafed86702312kmillikin@chromium.orgvar o = {x: 10};
349155e252524a2bf92aecd27493feafed86702312kmillikin@chromium.orgObject.defineProperty(o, "x", {value: 5});
359155e252524a2bf92aecd27493feafed86702312kmillikin@chromium.orgvar desc = Object.getOwnPropertyDescriptor(o, "x");
369155e252524a2bf92aecd27493feafed86702312kmillikin@chromium.orgassertTrue(desc["writable"]);
37