views:

91

answers:

1

I've a Javascript source that uses a Java class that defines a "delete" method (using jdk6 scripting). Since delete is a keyword, I cannot invoke that method.

In JavaFX script any sequence of characters enclosed in <> is treated as a lexical identifier. So you can use "insert", that is a keyword, as an identifier:

var textField = new javax.swing.JTextField();
textField.<<insert>>("Hello World");

Javascript provides a way to protect keywords?

+4  A: 

In javascript you would do:

textField["insert"]("Hello World");
Maurice Perry