java - Why is there commented-out code in native method? -


recently, i've seen lot of methods "native" keyword. seems common have, what seems like, commented out code.

public native foo(arg, arg) /*-{     var foo = some.method(arg);     return foo; }-*/; 

i don't understand what commented-out portion or why it's commented out. while i've thought commented out code. i'm starting see in more projects (for instance, it's in gwt source code).

is commented-out code significant in way don't understand? i've read native keyword, , understand means , how it's used in basic sense. it's confusing see "commented-out code" often.

can explain comments. comments? significant?

[update] question commented out portion. starting see enough thought there significance missing. annotation, instance. wanted clear onwhy there commented out sections of code littered over.

because gwt code compiled in 2 distinct part : java server part , javascript client one.

the comment syntax in native methods

  /*-{ javascript code }-*/ 

is gwt specific way write native javascript in gwt code.

see jsni


Comments

Popular posts from this blog

python - pip install -U PySide error -

arrays - C++ error: a brace-enclosed initializer is not allowed here before ‘{’ token -

cytoscape.js - How to add nodes to Dagre layout with Cytoscape -