THRIFT-3627 fix missing basic code style consistency of JavaScript.
Client: js
This closes #858
This closes #1243
diff --git a/lib/js/test/phantomjs-qunit.js b/lib/js/test/phantomjs-qunit.js
index a840db6..c1d7a5b 100755
--- a/lib/js/test/phantomjs-qunit.js
+++ b/lib/js/test/phantomjs-qunit.js
@@ -28,18 +28,18 @@
start = new Date().getTime(),
condition = false,
interval = setInterval(function() {
- if ( (new Date().getTime() - start < maxtimeOutMillis) && !condition ) {
+ if ((new Date().getTime() - start < maxtimeOutMillis) && !condition) {
// If not time-out yet and condition not yet fulfilled
- condition = (typeof(testFx) === "string" ? eval(testFx) : testFx()); //< defensive code
+ condition = (typeof(testFx) === 'string' ? eval(testFx) : testFx()); //< defensive code
} else {
- if(!condition) {
+ if (!condition) {
// If condition still not fulfilled (timeout but condition is 'false')
console.log("'waitFor()' timeout");
phantom.exit(1);
} else {
// Condition fulfilled (timeout and/or condition is 'true')
- console.log("'waitFor()' finished in " + (new Date().getTime() - start) + "ms.");
- if (typeof(onReady) === "string") {
+ console.log("'waitFor()' finished in " + (new Date().getTime() - start) + 'ms.');
+ if (typeof(onReady) === 'string') {
eval(onReady);
} else {
onReady(); //< Do what it's supposed to do once the condition is fulfilled
@@ -63,21 +63,21 @@
console.log(msg);
};
-page.open(system.args[1], function(status){
- if (status !== "success") {
- console.log("Unable to access network");
+page.open(system.args[1], function(status) {
+ if (status !== 'success') {
+ console.log('Unable to access network');
phantom.exit(1);
} else {
- waitFor(function(){
- return page.evaluate(function(){
+ waitFor(function() {
+ return page.evaluate(function() {
var el = document.getElementById('qunit-testresult');
if (el && el.innerText.match('completed')) {
return true;
}
return false;
});
- }, function(){
- var failedNum = page.evaluate(function(){
+ }, function() {
+ var failedNum = page.evaluate(function() {
var el = document.getElementById('qunit-testresult');
console.log(el.innerText);
try {