literal_mult_getters.js revision 877:cf4d2252d444
1279377Simp/* 2279377Simp * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved. 3279377Simp * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4279377Simp * 5279377Simp * This code is free software; you can redistribute it and/or modify it 6279377Simp * under the terms of the GNU General Public License version 2 only, as 7279377Simp * published by the Free Software Foundation. 8279377Simp * 9279377Simp * This code is distributed in the hope that it will be useful, but WITHOUT 10279377Simp * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11279377Simp * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 12279377Simp * version 2 for more details (a copy is included in the LICENSE file that 13279377Simp * accompanied this code). 14279377Simp * 15279377Simp * You should have received a copy of the GNU General Public License version 16279377Simp * 2 along with this work; if not, write to the Free Software Foundation, 17279377Simp * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 18279377Simp * 19279377Simp * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 20279377Simp * or visit www.oracle.com if you need additional information or have any 21279377Simp * questions. 22279377Simp */ 23279377Simp 24279377Simp/** 25279377Simp * Early error reporting. 26279377Simp * 27279377Simp * Attempts to define an ObjectLiteral that has multiple get property 28279377Simp * assignments with the same name or multiple set property assignments with 29279377Simp * the same name. 30279377Simp * 31279377Simp * @test/compile-error 32279377Simp */ 33279377Simp 34279377Simpprint(__FILE__ + " @" + __LINE__); 35279377Simp 36279377Simpvar obj = { get foo() { return 2; }, get foo() { return 'hello'; } }; 37279377Simp