Malformed PDE to ProcessingJs compililation in 2.0b8, processing-1.4.1.js
in
Processing with Other Languages
•
6 months ago
Hello,
I've run across an issue with a PDE not getting translated into proper javascript using 2.0b8 and processing-1.4.1.js.
I'm also posting this to the ProcessingJs mailing list.
It was throwing an error when trying to create the wrapper function, but I was able to grab the this.sourceCode contents in the debugger (Chrome)
Here is the gist with two files: the PDE and the output of the javascript compiler.
https://gist.github.com/danieljue/5347458
Of interest (from what I can see, I'm not a JavaScript guy) is line ~972 where I see what looks like internal compiler identifiers for parenthesis ( )
For instance I'm seeing this in the generated javascript:
- public setVisited"B754" "A755"
- public setDragging"B758" "A759"
- public isDragging"B760" "A761"function $constr_1(subject){
- $superCstr();
- $this_1.subject = subject;
- }
This was the related portion in the PDE:
- ...
- public setVisited(boolean visited) {
- this.visited = visited;
- }
- public boolean isVisited() {
- return this.visited;
- }
- public setDragging(boolean dragging) {
- this.dragging = dragging;
- }
- public isDragging() {
- return dragging;
- }
- ...
Aside:
This PDE is a modified/modernized version of the Neography/Neovigator/Askken donut graph code. It still has some unfortunate mixing of javascript functions in the PDE, which would keep you from using it in a regular Processing environment. It also requires some extra javascript files to get working. Once I have ironed out the bugs I'll be posting it on my github account.
1