hannesw@2023: /* hannesw@2023: * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. hannesw@2023: * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. hannesw@2023: * hannesw@2023: * This code is free software; you can redistribute it and/or modify it hannesw@2023: * under the terms of the GNU General Public License version 2 only, as hannesw@2023: * published by the Free Software Foundation. hannesw@2023: * hannesw@2023: * This code is distributed in the hope that it will be useful, but WITHOUT hannesw@2023: * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or hannesw@2023: * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License hannesw@2023: * version 2 for more details (a copy is included in the LICENSE file that hannesw@2023: * accompanied this code). hannesw@2023: * hannesw@2023: * You should have received a copy of the GNU General Public License version hannesw@2023: * 2 along with this work; if not, write to the Free Software Foundation, hannesw@2023: * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. hannesw@2023: * hannesw@2023: * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA hannesw@2023: * or visit www.oracle.com if you need additional information or have any hannesw@2023: * questions. hannesw@2023: */ hannesw@2023: hannesw@2023: /** hannesw@2023: * JDK-8176511: JSObject property access is broken for numeric keys outside the int range hannesw@2023: * hannesw@2023: * @test hannesw@2023: * @run hannesw@2023: */ hannesw@2023: hannesw@2023: hannesw@2023: var reassignWithNewGlobal = loadWithNewGlobal({ hannesw@2023: script: '(function (o, i) { o[i] = o[i]; })', name: 'internal.js' hannesw@2023: hannesw@2023: }); hannesw@2023: hannesw@2023: function test(i) { hannesw@2023: var o = {}; hannesw@2023: o[i] = true; hannesw@2023: var before = JSON.stringify(o); hannesw@2023: reassignWithNewGlobal(o, i); hannesw@2023: var after = JSON.stringify(o); hannesw@2023: Assert.assertEquals(before, after); hannesw@2023: } hannesw@2023: hannesw@2023: test(-2147483649); hannesw@2023: test(-2147483648); hannesw@2023: test(2147483647); hannesw@2023: test(2147483648); hannesw@2023: