|
W9222 JavaScript No JavaScript Code
[Previous]  [Next] 
|
![]() |
User Manual [Previous]  [Next] W9222 JavaScript No JavaScript CodeA method has a body only for other languagesA method written in the model has a body only for languages other than JavaScript, for example a Java body, and no untagged body. The JavaScript generator has no code to use for it, so it leaves the method out of the generated class and this warning names it. The class itself is still generated, and the warning does not make the compilation fail. Add a JavaScript body, written as Example
// describe has a Java body only, so the generated JavaScript
// leaves it out and W9222 names it
generate JavaScript;
class Book {
title;
String describe() Java { return "Book " + getTitle(); }
}
Load the above code into classic UmpleOnline Solution to The Above So the Message No Longer Appears
// With a JavaScript body as well, each generator uses its own
generate JavaScript;
class Book {
title;
String describe() Java { return "Book " + getTitle(); }
String describe() JavaScript { return "Book " + this.getTitle(); }
}
Load the above code into classic UmpleOnline |