jaroslav@1171: /** jaroslav@1171: * Back 2 Browser Bytecode Translator jaroslav@1171: * Copyright (C) 2012 Jaroslav Tulach jaroslav@1171: * jaroslav@1171: * This program is free software: you can redistribute it and/or modify jaroslav@1171: * it under the terms of the GNU General Public License as published by jaroslav@1171: * the Free Software Foundation, version 2 of the License. jaroslav@1171: * jaroslav@1171: * This program is distributed in the hope that it will be useful, jaroslav@1171: * but WITHOUT ANY WARRANTY; without even the implied warranty of jaroslav@1171: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the jaroslav@1171: * GNU General Public License for more details. jaroslav@1171: * jaroslav@1171: * You should have received a copy of the GNU General Public License jaroslav@1171: * along with this program. Look for COPYING file in the top folder. jaroslav@1171: * If not, see http://opensource.org/licenses/GPL-2.0. jaroslav@1171: */ jaroslav@1171: package org.apidesign.bck2brwsr.launcher.fximpl; jaroslav@1171: jaroslav@1171: /** jaroslav@1171: * jaroslav@1171: * @author Jaroslav Tulach jaroslav@1171: */ jaroslav@1171: public abstract class Fn { jaroslav@1171: public static Fn define(Class caller, String code, String... names) { jaroslav@1171: JsClassLoader cl = (JsClassLoader)caller.getClassLoader(); jaroslav@1171: return cl.defineFn(code, names); jaroslav@1171: } jaroslav@1171: jaroslav@1181: public abstract Object invoke(Object thiz, Object... args) throws Exception; jaroslav@1171: jaroslav@1171: }