Open Icare67 opened 3 years ago
Are you sure you are using the latest jsweet-core please?
Did you read this: https://github.com/cincheo/jsweet/issues/587 ?
I'm using this: [INFO] JSweet transpiler version 3.0.0 (build date: 2020-12-16 07:35:57) [INFO] dependencies=[Dependency {groupId=org.jsweet, artifactId=jsweet-core, version=6.3.0, type=jar}, Dependency {groupId=org.jsweet.candies, artifactId=jquery, version=1.10.0-20170726, type=jar}] [INFO] candies detection: add project dependency Dependency {groupId=org.jsweet, artifactId=jsweet-core, version=6.3.0, type=jar} => org.jsweet:jsweet-core:jar:6.3.0:compile [INFO] candies detection: add project dependency Dependency {groupId=org.jsweet.candies, artifactId=jquery, version=1.10.0-20170726, type=jar} => org.jsweet.candies:jquery:jar:1.10.0-20170726:compile
This is what I get by building a fresh git checkout of quickstart
What's your error please? As you can see, the build is passing on GitHub: https://github.com/cincheo/jsweet-quickstart
My bad, I didn't notice that you modified the quickstart code.
There is a discrepancy between Document.getElementsByTagName and Element.getElementsByTagName
https://github.com/cincheo/jsweet/blob/develop/core-lib/es6/src/main/java/def/dom/Element.java#L53 https://github.com/cincheo/jsweet/blob/develop/core-lib/es6/src/main/java/def/dom/Document.java#L675
If you want to fix Element's version. You can file a PR, I will merge it ASAP and deploy
Same for https://github.com/cincheo/jsweet/issues/693 if you feel like it :)
I try to use getElementsByTagName on an Element. See the two test at the bottom of this quickstart sample The following code does not compile: `package quickstart;
import static def.dom.Globals.alert; import static def.dom.Globals.document; import static def.jquery.Globals.$;
import java.util.ArrayList; import java.util.List;
import org.w3c.dom.NamedNodeMap;
import def.dom.HTMLCollectionOf; import def.dom.NodeListOf; import def.dom.HTMLDivElement; import def.js.Array; import jsweet.util.StringTypes;
import java.awt.Graphics2D; /**
This class is used within the webapp/index.html file. */ public class QuickStart {
public static void main(String[] args) { // you can use regular Java API List l = new ArrayList<>();
l.add("Hello");
l.add("world");
// and you can also use regular JavaScript APIs
Array a = new Array<>();
a.push("Hello", "world");
// use of jQuery with the jQuery candy
$("#target").text(l.toString());
// use of the JavaScript DOM API
alert(a.toString());
}
} `