jaroslav@1170: /** jaroslav@1170: * Back 2 Browser Bytecode Translator jaroslav@1170: * Copyright (C) 2012 Jaroslav Tulach jaroslav@1170: * jaroslav@1170: * This program is free software: you can redistribute it and/or modify jaroslav@1170: * it under the terms of the GNU General Public License as published by jaroslav@1170: * the Free Software Foundation, version 2 of the License. jaroslav@1170: * jaroslav@1170: * This program is distributed in the hope that it will be useful, jaroslav@1170: * but WITHOUT ANY WARRANTY; without even the implied warranty of jaroslav@1170: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the jaroslav@1170: * GNU General Public License for more details. jaroslav@1170: * jaroslav@1170: * You should have received a copy of the GNU General Public License jaroslav@1170: * along with this program. Look for COPYING file in the top folder. jaroslav@1170: * If not, see http://opensource.org/licenses/GPL-2.0. jaroslav@1170: */ jaroslav@1170: package org.apidesign.bck2brwsr.launcher.fximpl; jaroslav@1170: jaroslav@1170: import org.apidesign.bck2brwsr.core.JavaScriptBody; jaroslav@1170: jaroslav@1170: /** jaroslav@1170: * jaroslav@1170: * @author Jaroslav Tulach jaroslav@1170: */ jaroslav@1170: public class JsMethods { jaroslav@1170: @JavaScriptBody(args = {}, body = "return 42;") jaroslav@1170: public static Object fortyTwo() { jaroslav@1170: return -42; jaroslav@1170: } jaroslav@1170: jaroslav@1170: @JavaScriptBody(args = {"x", "y" }, body = "return x + y;") jaroslav@1176: public static native int plus(int x, int y); jaroslav@1178: jaroslav@1178: @JavaScriptBody(args = {"x"}, body = "return x;") jaroslav@1178: public static native int plus(int x); jaroslav@1181: jaroslav@1181: @JavaScriptBody(args = {}, body = "return this;") jaroslav@1181: public static native Object staticThis(); jaroslav@1181: jaroslav@1181: @JavaScriptBody(args = {}, body = "return this;") jaroslav@1181: public native Object getThis(); jaroslav@1181: @JavaScriptBody(args = {"x"}, body = "return x;") jaroslav@1181: public native int plusInst(int x); jaroslav@1170: }