hannesw@1354: /* hannesw@1354: * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. hannesw@1354: * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. hannesw@1354: * hannesw@1354: * This code is free software; you can redistribute it and/or modify it hannesw@1354: * under the terms of the GNU General Public License version 2 only, as hannesw@1354: * published by the Free Software Foundation. hannesw@1354: * hannesw@1354: * This code is distributed in the hope that it will be useful, but WITHOUT hannesw@1354: * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or hannesw@1354: * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License hannesw@1354: * version 2 for more details (a copy is included in the LICENSE file that hannesw@1354: * accompanied this code). hannesw@1354: * hannesw@1354: * You should have received a copy of the GNU General Public License version hannesw@1354: * 2 along with this work; if not, write to the Free Software Foundation, hannesw@1354: * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. hannesw@1354: * hannesw@1354: * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA hannesw@1354: * or visit www.oracle.com if you need additional information or have any hannesw@1354: * questions. hannesw@1354: */ hannesw@1354: hannesw@1354: /** hannesw@1354: * hannesw@1354: JDK-8066226: Fuzzing bug: parameter counts differ in TypeConverterFactory hannesw@1354: * hannesw@1354: * @test hannesw@1354: * @run hannesw@1354: */ hannesw@1354: hannesw@1354: Object.defineProperty(Object.prototype, "accessor", { hannesw@1354: set: function(value) { hannesw@1354: print("Setting accessor on " + this + " to " + value); hannesw@1354: } hannesw@1354: }); hannesw@1354: hannesw@1354: Object.defineProperty(Object.prototype, "getterOnly", { hannesw@1354: get: function() { hannesw@1354: return 1; hannesw@1354: } hannesw@1354: }); hannesw@1354: hannesw@1354: function set(o) { hannesw@1354: print("set(" + o + ")"); hannesw@1354: o.foo = 1; hannesw@1354: o.constructor = 1; hannesw@1354: o.accessor = 1; hannesw@1354: o.getterOnly = 1; hannesw@1354: print(); hannesw@1354: } hannesw@1354: hannesw@1354: function setStrict(o) { hannesw@1354: "use strict"; hannesw@1354: print("setStrict(" + o + ")") hannesw@1354: try { hannesw@1354: o.foo = 1; hannesw@1354: } catch (e) { hannesw@1354: print(e); hannesw@1354: } hannesw@1354: try { hannesw@1354: o.constructor = 1; hannesw@1354: } catch (e) { hannesw@1354: print(e); hannesw@1354: } hannesw@1354: try { hannesw@1354: o.accessor = 1; hannesw@1354: } catch (e) { hannesw@1354: print(e); hannesw@1354: } hannesw@1354: try { hannesw@1354: o.getterOnly = 1; hannesw@1354: } catch (e) { hannesw@1354: print(e); hannesw@1354: } hannesw@1354: print(); hannesw@1354: } hannesw@1354: hannesw@1354: function setAttr(o, id) { hannesw@1354: print("setAttr(" + o + ", " + id + ")") hannesw@1354: o[id] = 1; hannesw@1354: print(); hannesw@1354: } hannesw@1354: hannesw@1354: function setAttrStrict(o, id) { hannesw@1354: "use strict"; hannesw@1354: print("setAttrStrict(" + o + ", " + id + ")") hannesw@1354: try { hannesw@1354: o[id] = 1; hannesw@1354: } catch (e) { hannesw@1354: print(e); hannesw@1354: } hannesw@1354: print(); hannesw@1354: } hannesw@1354: hannesw@1354: set(1); hannesw@1354: set("str"); hannesw@1354: set(true); hannesw@1354: set({}); hannesw@1354: set([]); hannesw@1354: hannesw@1354: setStrict(1); hannesw@1354: setStrict("str"); hannesw@1354: setStrict(true); hannesw@1354: setStrict({}); hannesw@1354: setStrict([]); hannesw@1354: hannesw@1354: setAttr(1, "foo"); hannesw@1354: setAttr(1, "constructor"); hannesw@1354: setAttr(1, "accessor"); hannesw@1354: setAttr(1, "getterOnly"); hannesw@1354: setAttr("str", "foo"); hannesw@1354: setAttr("str", "constructor"); hannesw@1354: setAttr("str", "accessor"); hannesw@1354: setAttr("str", "getterOnly"); hannesw@1354: setAttr(true, "foo"); hannesw@1354: setAttr(true, "constructor"); hannesw@1354: setAttr(true, "accessor"); hannesw@1354: setAttr(true, "getterOnly"); hannesw@1354: hannesw@1354: setAttrStrict(1, "foo"); hannesw@1354: setAttrStrict(1, "constructor"); hannesw@1354: setAttrStrict(1, "accessor"); hannesw@1354: setAttrStrict(1, "getterOnly"); hannesw@1354: setAttrStrict("str", "foo"); hannesw@1354: setAttrStrict("str", "constructor"); hannesw@1354: setAttrStrict("str", "accessor"); hannesw@1354: setAttrStrict("str", "getterOnly"); hannesw@1354: setAttrStrict(true, "foo"); hannesw@1354: setAttrStrict(true, "constructor"); hannesw@1354: setAttrStrict(true, "accessor"); hannesw@1354: setAttrStrict(true, "getterOnly");