From 57e7c0a72c2eccd1031f88b153094cb47c31a011 Mon Sep 17 00:00:00 2001 From: Seungkeun Lee Date: Tue, 8 Dec 2015 08:59:51 +0900 Subject: [PATCH] gjslint result apply - apply javascript lint - https://developers.google.com/closure/utilities/docs/linter_howto Change-Id: I220c9dc69c9aba23d54477e1ea723b157c432a60 --- .../how-to-oop/how-to-implement-inheritance.js | 14 +++++------ examples/how-to/how-to-oop/how-to-make-class.js | 6 ++--- .../how-to-oop/how-to-make-private-property.js | 12 +++++----- .../player_api.js | 28 +++++++++++----------- examples/modules/v8/tizen_power/main.js | 4 ++-- examples/modules/xwalk/echo/echo_api.js | 2 +- .../xwalk/tizen_power/xwalk/js/power_manager.js | 18 +++++++------- 7 files changed, 42 insertions(+), 42 deletions(-) diff --git a/examples/how-to/how-to-oop/how-to-implement-inheritance.js b/examples/how-to/how-to-oop/how-to-implement-inheritance.js index c3d3a05..83b7272 100755 --- a/examples/how-to/how-to-oop/how-to-implement-inheritance.js +++ b/examples/how-to/how-to-oop/how-to-implement-inheritance.js @@ -1,4 +1,4 @@ -"use strict"; +'use strict'; var Person = require('./how-to-make-class.js'); @@ -11,23 +11,23 @@ class Employee extends Person { // method override getGreetings() { var msg = super.getGreetings(); - msg += " in " + this.company; + msg += ' in ' + this.company; return msg; } getBonus() { return false; } -} +}; class President extends Employee { getBonus() { return true; } -} +}; -module.exports = { 'Employee':Employee, - 'President':President }; +module.exports = { 'Employee': Employee, + 'President': President }; if (require.main === module) { // Test code @@ -41,6 +41,6 @@ if (require.main === module) { console.log(vp.getGreetings()); console.log('My bonus is ' + vp.getBonus()); - console.log("People count : " + Person.howManyPeople()); + console.log('People count : ' + Person.howManyPeople()); } diff --git a/examples/how-to/how-to-oop/how-to-make-class.js b/examples/how-to/how-to-oop/how-to-make-class.js index 216275d..3be6f84 100755 --- a/examples/how-to/how-to-oop/how-to-make-class.js +++ b/examples/how-to/how-to-oop/how-to-make-class.js @@ -1,4 +1,4 @@ -"use strict"; +'use strict'; // ES6 class reference // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes @@ -18,7 +18,7 @@ class Person { } getGreetings() { - return "Hello, My name is "+ this.name; + return 'Hello, My name is '+ this.name; } static howManyPeople() { @@ -38,5 +38,5 @@ if (require.main === module) { console.log(park.name); console.log(park.getGreetings()); - console.log("People count : " + Person.howManyPeople()); + console.log('People count : ' + Person.howManyPeople()); } diff --git a/examples/how-to/how-to-oop/how-to-make-private-property.js b/examples/how-to/how-to-oop/how-to-make-private-property.js index 7be441a..333d3e4 100755 --- a/examples/how-to/how-to-oop/how-to-make-private-property.js +++ b/examples/how-to/how-to-oop/how-to-make-private-property.js @@ -1,24 +1,24 @@ -"use strict"; +'use strict'; var my_secret_key = Symbol(); var my_secret_function = Symbol(); class Secret { constructor() { - this[my_secret_key] = Math.random()*100; + this[my_secret_key] = Math.random() * 100; this[my_secret_function] = function(args) { - console.log('orignal data is = '+ args); - } + console.log('orignal data is = ' + args); + }; } GetUserSecretKey(data) { this[my_secret_function](data); var crypto = require('crypto'); var sha1 = crypto.createHash('sha1').update(data + this[my_secret_key]); - return sha1.digest("hex"); + return sha1.digest('hex'); } -} +}; module.exports = Secret; diff --git a/examples/how-to/how-to-sync-js-object-and-native-object-lifecycle/player_api.js b/examples/how-to/how-to-sync-js-object-and-native-object-lifecycle/player_api.js index 1843df1..8f5a20b 100755 --- a/examples/how-to/how-to-sync-js-object-and-native-object-lifecycle/player_api.js +++ b/examples/how-to/how-to-sync-js-object-and-native-object-lifecycle/player_api.js @@ -19,7 +19,7 @@ var playerListener = null; extension.setMessageListener(function(msg) { if (playerListener instanceof Function) { playerListener(msg); - }; + } }); function ReturnResult(result) { @@ -31,7 +31,7 @@ function ReturnResult(result) { console.log(ret['reason']); return false; } -}; +} var Player = function() { var args = { @@ -40,7 +40,7 @@ var Player = function() { var ret = JSON.parse(extension.internal.sendSyncMessage(JSON.stringify(args))); if (ret['result'] == 'OK') { this.id = ret['id']; - require('reaper').setReaper(this, function(deleted){ + require('reaper').setReaper(this, function(deleted) { var args = { 'cmd': 'Destroy', 'id': deleted.id, @@ -52,41 +52,41 @@ var Player = function() { Player.prototype.setUri = function(path) { var args = { - 'cmd':'SetUri', - 'path':path, - 'id':this.id, + 'cmd': 'SetUri', + 'path': path, + 'id': this.id, }; return ReturnResult(extension.internal.sendSyncMessage(JSON.stringify(args))); }; Player.prototype.prepare = function() { var args = { - 'cmd':'Prepare', - 'id':this.id, + 'cmd': 'Prepare', + 'id': this.id, }; return ReturnResult(extension.internal.sendSyncMessage(JSON.stringify(args))); }; Player.prototype.start = function() { var args = { - 'cmd':'Start', - 'id':this.id, + 'cmd': 'Start', + 'id': this.id, }; return ReturnResult(extension.internal.sendSyncMessage(JSON.stringify(args))); }; Player.prototype.stop = function() { var args = { - 'cmd':'Stop', - 'id':this.id, + 'cmd': 'Stop', + 'id': this.id, }; return ReturnResult(extension.internal.sendSyncMessage(JSON.stringify(args))); }; Player.prototype.unprepare = function() { var args = { - 'cmd':'Unprepare', - 'id':this.id, + 'cmd': 'Unprepare', + 'id': this.id, }; return ReturnResult(extension.internal.sendSyncMessage(JSON.stringify(args))); }; diff --git a/examples/modules/v8/tizen_power/main.js b/examples/modules/v8/tizen_power/main.js index 6cd8bff..e32609f 100644 --- a/examples/modules/v8/tizen_power/main.js +++ b/examples/modules/v8/tizen_power/main.js @@ -33,7 +33,7 @@ function TizenPowerManager() { TizenPowerManager.prototype.request = function(resource, state) { if (PowerResource.indexOf(resource) < 0 || PowerState.indexOf(state) < 0) { - throw "TypeMismatch Error"; + throw 'TypeMismatch Error'; } return native_.request(resource, state); @@ -41,7 +41,7 @@ TizenPowerManager.prototype.request = function(resource, state) { TizenPowerManager.prototype.release = function(resource) { if (PowerResource.indexOf(resource) < 0) { - throw "TypeMismatch Error"; + throw 'TypeMismatch Error'; } return native_.release(resource); diff --git a/examples/modules/xwalk/echo/echo_api.js b/examples/modules/xwalk/echo/echo_api.js index 0cc050c..6d5e275 100644 --- a/examples/modules/xwalk/echo/echo_api.js +++ b/examples/modules/xwalk/echo/echo_api.js @@ -19,7 +19,7 @@ var echoListener = null; extension.setMessageListener(function(msg) { if (echoListener instanceof Function) { echoListener(msg); - }; + } }); exports.echo = function(msg, callback) { diff --git a/examples/modules/xwalk/tizen_power/xwalk/js/power_manager.js b/examples/modules/xwalk/tizen_power/xwalk/js/power_manager.js index da46af1..bbddc3a 100644 --- a/examples/modules/xwalk/tizen_power/xwalk/js/power_manager.js +++ b/examples/modules/xwalk/tizen_power/xwalk/js/power_manager.js @@ -41,7 +41,7 @@ function PowerManager() { */ PowerManager.prototype.request = function(resource, state) { if (PowerResource.indexOf(resource) < 0 || PowerState.indexOf(state) < 0) { - throw "TypeMismatch Error"; + throw 'TypeMismatch Error'; } var args = { @@ -60,7 +60,7 @@ PowerManager.prototype.request = function(resource, state) { */ PowerManager.prototype.release = function(resource) { if (PowerResource.indexOf(resource) < 0) { - throw "TypeMismatch Error"; + throw 'TypeMismatch Error'; } var args = { @@ -95,11 +95,11 @@ PowerManager.prototype.getScreenBrightness = function() { 'cmd': 'getScreenBrightness' }; var ret = extension.internal.sendSyncMessage(JSON.stringify(args)); - if (ret == "ERR") + if (ret == 'ERR') return false; else return parseFloat(ret); -} +}; /** * Sets the screen brightness level for an application, from 0 to 1. @@ -111,7 +111,7 @@ PowerManager.prototype.setScreenBrightness = function(brightness) { 'brightness': brightness }; extension.postMessage(JSON.stringify(args)); -} +}; /** * Returns true if the screen is on. @@ -122,8 +122,8 @@ PowerManager.prototype.isScreenOn = function() { 'cmd': 'isScreenOn' }; var ret = extension.internal.sendSyncMessage(JSON.stringify(args)); - return (ret == 'true') -} + return (ret == 'true'); +}; /** * Restores the screen brightness to the system default setting value. @@ -133,7 +133,7 @@ PowerManager.prototype.restoreScreenBrightness = function() { 'cmd': 'restoreScreenBrightness' }; extension.postMessage(JSON.stringify(args)); -} +}; /** * Turns on the screen. @@ -143,7 +143,7 @@ PowerManager.prototype.turnScreenOn = function() { 'cmd': 'turnScreenOn' }; extension.postMessage(JSON.stringify(args)); -} +}; /** * Turns off the screen. -- 2.7.4