diff --git a/teavm-jso-impl/src/main/java/org/teavm/jso/plugin/JS.java b/teavm-jso-impl/src/main/java/org/teavm/jso/plugin/JS.java index ea8c3afdf..496759487 100644 --- a/teavm-jso-impl/src/main/java/org/teavm/jso/plugin/JS.java +++ b/teavm-jso-impl/src/main/java/org/teavm/jso/plugin/JS.java @@ -78,6 +78,7 @@ final class JS { public static native boolean unwrapBoolean(JSObject value); @InjectedBy(JSNativeGenerator.class) + @PluggableDependency(JSNativeGenerator.class) public static native String unwrapString(JSObject value); public static JSArray wrap(T[] array) { diff --git a/teavm-tests/src/test/java/org/teavm/jso/test/JSOTest.java b/teavm-tests/src/test/java/org/teavm/jso/test/JSOTest.java deleted file mode 100644 index 73ba3ca18..000000000 --- a/teavm-tests/src/test/java/org/teavm/jso/test/JSOTest.java +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Copyright 2015 Alexey Andreev. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.teavm.jso.test; - -import static org.junit.Assert.*; -import org.junit.Test; -import org.teavm.jso.JSBody; -import org.teavm.jso.JSObject; - -/** - * - * @author Alexey Andreev - */ -public class JSOTest { - @Test - public void complexConstructorParenthesized() { - RegExp regexp = RegExp.create(); - assertEquals(".", regexp.getSource()); - } - - @Test - public void externalMethodsResolved() { - int r = jsMethod(new Callback() { - @Override public int call() { - return 23; - } - }); - assertEquals(23, r); - } - - interface Callback extends JSObject { - int call(); - } - - @JSBody(params = "cb", script = "return cb.call();") - private static native int jsMethod(Callback cb); -} diff --git a/teavm-tests/src/test/java/org/teavm/jso/test/RegExp.java b/teavm-tests/src/test/java/org/teavm/jso/test/RegExp.java deleted file mode 100644 index 6747fcecc..000000000 --- a/teavm-tests/src/test/java/org/teavm/jso/test/RegExp.java +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright 2015 Alexey Andreev. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.teavm.jso.test; - -import org.teavm.jso.JSBody; -import org.teavm.jso.JSObject; -import org.teavm.jso.JSProperty; - -/** - * - * @author Alexey Andreev - */ -public abstract class RegExp implements JSObject { - @JSProperty - public abstract String getSource(); - - @JSBody(params = {}, script = "return new RegExp();") - public static native RegExp create(); -}