-
Notifications
You must be signed in to change notification settings - Fork 10
Fix ClosureJS error #209
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix ClosureJS error #209
Conversation
app.MessageField.prototype.enterDocument = function() { | ||
app.MessageField.superClass_.enterDocument.call(this); | ||
|
||
var tt = ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I always thought this was an object at first glance, so I changed it to make it more clear that it's a string.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wondered if that was a linter fix, but perhaps not looking at the blame.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's one more outstanding use of setHtml here
rdm-app/templates/browse_models.tmpl
Line 103 in 5980e12
tt.setHtml('RDM Responder Test Score: ' + rating + '%'); |
js_src/pid_display.js
Outdated
'Type: ' + this._field_info['type'] + '<br>' + | ||
'Name: ' + this._field_info['name'] + '<br>'); | ||
var tt = 'Type: ' + this._field_info['type'] + '<br>'; | ||
tt += 'Name: ' + this._field_info['name'] + '<br>'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know how good the optimiser is, but this would be slightly better if it was just one concat of strings across two lines I think, or does it then throw an error and is that what the brackets were for?
Hi @FloEdelmann , See also #210 which stops it moaning about closure code we can't control. |
I wonder if
Is because of the slightly odd dependency tree? We define MessageStructure: Then it's update method (which refers to MessageGroup's update method): Finally we define MessageGroup as a child of MessageStructure: So it's all a bit circular! It might be worth trying to move the MessageGroup stuff above the update stuff and see if that fixes the warning. |
This one:
Looks like a typo, or something that never got updated. Compare the JS Doc, to the code: In which case it's been wrong since the beginning: Anyway I suspect they should be: Thoughts @nomis52 ? |
Moving |
js_src/pid_display.js
Outdated
'Type: ' + this._field_info['type'] + '<br>' + | ||
'Name: ' + this._field_info['name'] + '<br>'); | ||
var tt = 'Type: ' + this._field_info['type'] + '<br>' + | ||
'Name: ' + this._field_info['name'] + '<br>'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we space the 'Name: ' bit to align below Type please.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. While it doesn't fix all the outstanding errors it certainly looks to improve things!
This fixes the error mentioned in #128 (comment).
There are two warnings left when running
grunt closure-compiler
:I don't know enough of their purpose to decide what to do with them.