NASHORN-415.js revision 2:da1e581c933b
1139804Simp/* 248391Speter * Copyright (c) 2010, 2012, Oracle and/or its affiliates. All rights reserved. 348391Speter * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 448391Speter * 548391Speter * This code is free software; you can redistribute it and/or modify it 648391Speter * under the terms of the GNU General Public License version 2 only, as 748391Speter * published by the Free Software Foundation. 848391Speter * 948391Speter * This code is distributed in the hope that it will be useful, but WITHOUT 1048391Speter * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 1148391Speter * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 1248391Speter * version 2 for more details (a copy is included in the LICENSE file that 1348391Speter * accompanied this code). 1448391Speter * 1548391Speter * You should have received a copy of the GNU General Public License version 1648391Speter * 2 along with this work; if not, write to the Free Software Foundation, 1748391Speter * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 1848391Speter * 1948391Speter * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 2048391Speter * or visit www.oracle.com if you need additional information or have any 2148391Speter * questions. 2248391Speter */ 2348391Speter 2448391Speter/** 2548391Speter * NASHORN-415 : Object.keys should return String indexes for String objects 2648391Speter * 27116182Sobrien * @test 28116182Sobrien * @run 29116182Sobrien */ 3048391Speter 3148391Spetervar str = new String("hello"); 3248391Speter 3370317Sjakeprint(Object.keys(str)); 3474927Sjhbstr.foo = 33; 3574927Sjhbprint(Object.keys(str)); 3655722Simp