149edbdf52640c88918f8e6638ab4965819eb1dfekmillikin@chromium.org// Copyright 2011 the V8 project authors. All rights reserved. 249edbdf52640c88918f8e6638ab4965819eb1dfekmillikin@chromium.org// Redistribution and use in source and binary forms, with or without 349edbdf52640c88918f8e6638ab4965819eb1dfekmillikin@chromium.org// modification, are permitted provided that the following conditions are 449edbdf52640c88918f8e6638ab4965819eb1dfekmillikin@chromium.org// met: 549edbdf52640c88918f8e6638ab4965819eb1dfekmillikin@chromium.org// 649edbdf52640c88918f8e6638ab4965819eb1dfekmillikin@chromium.org// * Redistributions of source code must retain the above copyright 749edbdf52640c88918f8e6638ab4965819eb1dfekmillikin@chromium.org// notice, this list of conditions and the following disclaimer. 849edbdf52640c88918f8e6638ab4965819eb1dfekmillikin@chromium.org// * Redistributions in binary form must reproduce the above 949edbdf52640c88918f8e6638ab4965819eb1dfekmillikin@chromium.org// copyright notice, this list of conditions and the following 1049edbdf52640c88918f8e6638ab4965819eb1dfekmillikin@chromium.org// disclaimer in the documentation and/or other materials provided 1149edbdf52640c88918f8e6638ab4965819eb1dfekmillikin@chromium.org// with the distribution. 1249edbdf52640c88918f8e6638ab4965819eb1dfekmillikin@chromium.org// * Neither the name of Google Inc. nor the names of its 1349edbdf52640c88918f8e6638ab4965819eb1dfekmillikin@chromium.org// contributors may be used to endorse or promote products derived 1449edbdf52640c88918f8e6638ab4965819eb1dfekmillikin@chromium.org// from this software without specific prior written permission. 1549edbdf52640c88918f8e6638ab4965819eb1dfekmillikin@chromium.org// 1649edbdf52640c88918f8e6638ab4965819eb1dfekmillikin@chromium.org// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 1749edbdf52640c88918f8e6638ab4965819eb1dfekmillikin@chromium.org// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 1849edbdf52640c88918f8e6638ab4965819eb1dfekmillikin@chromium.org// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 1949edbdf52640c88918f8e6638ab4965819eb1dfekmillikin@chromium.org// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 2049edbdf52640c88918f8e6638ab4965819eb1dfekmillikin@chromium.org// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 2149edbdf52640c88918f8e6638ab4965819eb1dfekmillikin@chromium.org// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 2249edbdf52640c88918f8e6638ab4965819eb1dfekmillikin@chromium.org// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 2349edbdf52640c88918f8e6638ab4965819eb1dfekmillikin@chromium.org// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 2449edbdf52640c88918f8e6638ab4965819eb1dfekmillikin@chromium.org// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 2549edbdf52640c88918f8e6638ab4965819eb1dfekmillikin@chromium.org// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 2649edbdf52640c88918f8e6638ab4965819eb1dfekmillikin@chromium.org// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 2749edbdf52640c88918f8e6638ab4965819eb1dfekmillikin@chromium.org 2849edbdf52640c88918f8e6638ab4965819eb1dfekmillikin@chromium.org// See http://crbug.com/72736 2949edbdf52640c88918f8e6638ab4965819eb1dfekmillikin@chromium.org 3049edbdf52640c88918f8e6638ab4965819eb1dfekmillikin@chromium.org// This tests that Object.defineProperty actually allows to change the value of 3149edbdf52640c88918f8e6638ab4965819eb1dfekmillikin@chromium.org// a non-writable property if configurable is true. 3249edbdf52640c88918f8e6638ab4965819eb1dfekmillikin@chromium.org 3349edbdf52640c88918f8e6638ab4965819eb1dfekmillikin@chromium.orgvar obj = {}; 3449edbdf52640c88918f8e6638ab4965819eb1dfekmillikin@chromium.orgObject.defineProperty(obj, 'foo', { value: 10, configurable: true }); 3549edbdf52640c88918f8e6638ab4965819eb1dfekmillikin@chromium.orgassertEquals(obj.foo, 10); 3649edbdf52640c88918f8e6638ab4965819eb1dfekmillikin@chromium.orgObject.defineProperty(obj, 'foo', { value: 20, configurable: true }); 3749edbdf52640c88918f8e6638ab4965819eb1dfekmillikin@chromium.orgassertEquals(obj.foo, 20); 38