Tue, 16 Aug 2016 21:41:28 -0700
Added tag jdk8u102-b33 for changeset 36e3c21b5fca
hannesw@1249 | 1 | /* |
hannesw@1249 | 2 | * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. |
hannesw@1249 | 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
hannesw@1249 | 4 | * |
hannesw@1249 | 5 | * This code is free software; you can redistribute it and/or modify it |
hannesw@1249 | 6 | * under the terms of the GNU General Public License version 2 only, as |
hannesw@1249 | 7 | * published by the Free Software Foundation. |
hannesw@1249 | 8 | * |
hannesw@1249 | 9 | * This code is distributed in the hope that it will be useful, but WITHOUT |
hannesw@1249 | 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
hannesw@1249 | 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
hannesw@1249 | 12 | * version 2 for more details (a copy is included in the LICENSE file that |
hannesw@1249 | 13 | * accompanied this code). |
hannesw@1249 | 14 | * |
hannesw@1249 | 15 | * You should have received a copy of the GNU General Public License version |
hannesw@1249 | 16 | * 2 along with this work; if not, write to the Free Software Foundation, |
hannesw@1249 | 17 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
hannesw@1249 | 18 | * |
hannesw@1249 | 19 | * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
hannesw@1249 | 20 | * or visit www.oracle.com if you need additional information or have any |
hannesw@1249 | 21 | * questions. |
hannesw@1249 | 22 | */ |
hannesw@1249 | 23 | |
hannesw@1249 | 24 | /** |
hannesw@1249 | 25 | * JDK-8074556: Functions should not share allocator maps |
hannesw@1249 | 26 | * |
hannesw@1249 | 27 | * @test |
hannesw@1249 | 28 | * @run |
hannesw@1249 | 29 | */ |
hannesw@1249 | 30 | |
hannesw@1249 | 31 | function A () { |
hannesw@1249 | 32 | return this; |
hannesw@1249 | 33 | } |
hannesw@1249 | 34 | |
hannesw@1249 | 35 | function B() { |
hannesw@1249 | 36 | return this; |
hannesw@1249 | 37 | } |
hannesw@1249 | 38 | |
hannesw@1249 | 39 | A.prototype.x = "x"; |
hannesw@1249 | 40 | A.prototype.y = "y"; |
hannesw@1249 | 41 | B.prototype.y = "y"; // same properties but different order |
hannesw@1249 | 42 | B.prototype.x = "x"; |
hannesw@1249 | 43 | |
hannesw@1249 | 44 | function test(o) { |
hannesw@1249 | 45 | Assert.assertEquals(o.x, "x"); |
hannesw@1249 | 46 | Assert.assertEquals(o.y, "y"); |
hannesw@1249 | 47 | } |
hannesw@1249 | 48 | |
hannesw@1249 | 49 | test(new A()); |
hannesw@1249 | 50 | test(new B()); |
hannesw@1249 | 51 | test(new A()); |
hannesw@1249 | 52 | test(new B()); |