hannesw@1356: /* hannesw@1356: * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. hannesw@1356: * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. hannesw@1356: * hannesw@1356: * This code is free software; you can redistribute it and/or modify it hannesw@1356: * under the terms of the GNU General Public License version 2 only, as hannesw@1356: * published by the Free Software Foundation. hannesw@1356: * hannesw@1356: * This code is distributed in the hope that it will be useful, but WITHOUT hannesw@1356: * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or hannesw@1356: * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License hannesw@1356: * version 2 for more details (a copy is included in the LICENSE file that hannesw@1356: * accompanied this code). hannesw@1356: * hannesw@1356: * You should have received a copy of the GNU General Public License version hannesw@1356: * 2 along with this work; if not, write to the Free Software Foundation, hannesw@1356: * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. hannesw@1356: * hannesw@1356: * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA hannesw@1356: * or visit www.oracle.com if you need additional information or have any hannesw@1356: * questions. hannesw@1356: */ hannesw@1356: hannesw@1356: /** hannesw@1356: * JDK-8066214: Fuzzing bug: Object.prototype.toLocaleString(0) hannesw@1356: * hannesw@1356: * @test hannesw@1356: * @run hannesw@1356: */ hannesw@1356: hannesw@1356: function test(func) { hannesw@1356: print(func.call(0)); hannesw@1356: print(func.call("abc")); hannesw@1356: print(func.call(true)); hannesw@1356: try { hannesw@1356: print(func.call(undefined)); hannesw@1356: } catch (e) { hannesw@1356: print(e); hannesw@1356: } hannesw@1356: try { hannesw@1356: print(func.call(null)); hannesw@1356: } catch (e) { hannesw@1356: print(e); hannesw@1356: } hannesw@1356: } hannesw@1356: hannesw@1356: test(Object.prototype.toLocaleString); hannesw@1356: test(Object.prototype.toString); hannesw@1356: test(Object.prototype.valueOf);