NASHORN-130.js revision 2:da1e581c933b
1205821Sedwin/*
213877Swosch * Copyright (c) 2010, 2012, Oracle and/or its affiliates. All rights reserved.
313877Swosch * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
413877Swosch *
513877Swosch * This code is free software; you can redistribute it and/or modify it
613877Swosch * under the terms of the GNU General Public License version 2 only, as
713877Swosch * published by the Free Software Foundation.
813877Swosch *
913877Swosch * This code is distributed in the hope that it will be useful, but WITHOUT
1013877Swosch * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
1113877Swosch * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
1213877Swosch * version 2 for more details (a copy is included in the LICENSE file that
1313877Swosch * accompanied this code).
1413877Swosch *
1513877Swosch * You should have received a copy of the GNU General Public License version
1613877Swosch * 2 along with this work; if not, write to the Free Software Foundation,
1713877Swosch * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
1813877Swosch *
1913877Swosch * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
2013877Swosch * or visit www.oracle.com if you need additional information or have any
2113877Swosch * questions.
2213877Swosch */
2313877Swosch
2413877Swosch/**
2513877Swosch * NASHORN-130 :  prototype comparison throws java class cast exception
2613877Swosch *
2713877Swosch * @test
2859945Sphantom * @run
2959945Sphantom */
3013877Swosch
3113877Swoschfunction Func() {
32129814Sstefanf}
33129814Sstefanf
3413877SwoschFunc.prototype = Object;
35205821Sedwinvar f = new Func();
36205821Sedwinif (f.prototype !== Object.prototype) {
37205821Sedwin    fail("f.prototype should be Object.prototype");
38205821Sedwin}
39205821Sedwin