sundar@1208: /* sundar@1208: * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. sundar@1208: * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. sundar@1208: * sundar@1208: * This code is free software; you can redistribute it and/or modify it sundar@1208: * under the terms of the GNU General Public License version 2 only, as sundar@1208: * published by the Free Software Foundation. sundar@1208: * sundar@1208: * This code is distributed in the hope that it will be useful, but WITHOUT sundar@1208: * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or sundar@1208: * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License sundar@1208: * version 2 for more details (a copy is included in the LICENSE file that sundar@1208: * accompanied this code). sundar@1208: * sundar@1208: * You should have received a copy of the GNU General Public License version sundar@1208: * 2 along with this work; if not, write to the Free Software Foundation, sundar@1208: * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. sundar@1208: * sundar@1208: * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA sundar@1208: * or visit www.oracle.com if you need additional information or have any sundar@1208: * questions. sundar@1208: */ sundar@1208: sundar@1208: /** sundar@1208: * JDK-8067854: bound java static method throws NPE when 'null' is used for this argument sundar@1208: * sundar@1208: * @test sundar@1208: * @run sundar@1208: */ sundar@1208: sundar@1208: getProp = java.lang.System.getProperty; sundar@1208: sundar@1208: // bind this and an argument. "null" for this as getProperty is a sundar@1208: // static method of java.lang.System sundar@1208: getHome = Function.prototype.bind.call(getProp, null, "java.home"); sundar@1208: sundar@1208: if (getHome() != getProp("java.home")) { sundar@1208: fail("getHome() failed to get java.home"); sundar@1208: }