JDK-8011718.js revision 263:fc20983ef38e
1237263Snp/* 2237263Snp * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved. 3237263Snp * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4237263Snp * 5237263Snp * This code is free software; you can redistribute it and/or modify it 6237263Snp * under the terms of the GNU General Public License version 2 only, as 7237263Snp * published by the Free Software Foundation. 8237263Snp * 9237263Snp * This code is distributed in the hope that it will be useful, but WITHOUT 10237263Snp * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11237263Snp * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 12237263Snp * version 2 for more details (a copy is included in the LICENSE file that 13237263Snp * accompanied this code). 14237263Snp * 15237263Snp * You should have received a copy of the GNU General Public License version 16237263Snp * 2 along with this work; if not, write to the Free Software Foundation, 17237263Snp * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 18237263Snp * 19237263Snp * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 20237263Snp * or visit www.oracle.com if you need additional information or have any 21237263Snp * questions. 22237263Snp */ 23237263Snp 24237263Snp/** 25237263Snp * JDK-8011718: binding already bound function with extra arguments fails. 26237263Snp * 27237263Snp * @test 28237263Snp * @run 29237263Snp */ 30237263Snp 31237263Snpvar obj = { 32237263Snp hello:"From obj", 33237263Snp}; 34237263Snpvar obj2 = { 35237263Snp hello:"From obj2", 36237263Snp}; 37237263Snp 38237263Snpfunction doit(cb){ 39237263Snp cb(); 40237263Snp var cb2 = cb.bind(obj2, "This one is not acccepted"); 41237263Snp cb2(); 42237263Snp} 43237263Snp 44237263Snpdoit(function(){ 45237263Snp print(this.hello); 46237263Snp }.bind(obj)); 47237263Snp