NASHORN-225.js revision 6:5a1b0714df0e
1179896Sdelphij/* 2179896Sdelphij * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved. 3179896Sdelphij * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4179896Sdelphij * 5179896Sdelphij * This code is free software; you can redistribute it and/or modify it 6179896Sdelphij * under the terms of the GNU General Public License version 2 only, as 7179896Sdelphij * published by the Free Software Foundation. 8179896Sdelphij * 9179896Sdelphij * This code is distributed in the hope that it will be useful, but WITHOUT 10179896Sdelphij * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11179896Sdelphij * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 12179896Sdelphij * version 2 for more details (a copy is included in the LICENSE file that 13179896Sdelphij * accompanied this code). 14179896Sdelphij * 15179896Sdelphij * You should have received a copy of the GNU General Public License version 16179896Sdelphij * 2 along with this work; if not, write to the Free Software Foundation, 17179896Sdelphij * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 18179896Sdelphij * 19179896Sdelphij * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 20179896Sdelphij * or visit www.oracle.com if you need additional information or have any 21179896Sdelphij * questions. 22179896Sdelphij */ 23179896Sdelphij 24179896Sdelphij/** 25179896Sdelphij * NASHORN-225 : Object.isFrozen does not handle accessor properties as per the spec 26179896Sdelphij * 27179896Sdelphij * @test 28179896Sdelphij * @run 29179896Sdelphij */ 30179896Sdelphij 31179896Sdelphijvar obj = {}; 32179896SdelphijObject.defineProperty(obj, "foo", { 33179896Sdelphij get: function() { return 'hello' }, 34179896Sdelphij configurable: true 35179896Sdelphij}); 36179896Sdelphij 37179896SdelphijObject.preventExtensions(obj); 38179896Sdelphijif (Object.isFrozen(obj)) { 39179896Sdelphij fail("obj should not be frozen!"); 40179896Sdelphij} 41179896Sdelphij