Replace 'var ' with 'const '

This commit is contained in:
Tyler Long
2017-09-14 20:17:27 +08:00
parent 8da5f26452
commit d31e03d04e
4 changed files with 361 additions and 364 deletions

View File

@@ -8,13 +8,11 @@ describe('when parsing an info graph it', function () {
})
it('should handle an info definition', function () {
var str = 'info\nsay: hello'
const str = 'info\nsay: hello'
parser.parse(str)
})
it('should handle an showMessage statement definition', function () {
var str = 'info\nshowInfo'
const str = 'info\nshowInfo'
parser.parse(str)
})
})

View File

@@ -1,7 +1,7 @@
import { logger } from '../../logger'
var message = ''
var info = false
let message = ''
let info = false
export const setMessage = function (txt) {
logger.debug('Setting message to: ' + txt)

View File

@@ -10,17 +10,16 @@ import { logger } from '../../logger'
* @param id
*/
export const draw = function (txt, id, ver) {
var parser
parser = exampleParser.parser
const parser = exampleParser.parser
parser.yy = db
logger.debug('Renering example diagram')
// Parse the graph definition
parser.parse(txt)
// Fetch the default direction, use TD if none was found
var svg = d3.select('#' + id)
const svg = d3.select('#' + id)
var g = svg.append('g')
const g = svg.append('g')
g.append('text') // text label for the x axis
.attr('x', 100)

File diff suppressed because it is too large Load Diff