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 () { it('should handle an info definition', function () {
var str = 'info\nsay: hello' const str = 'info\nsay: hello'
parser.parse(str) parser.parse(str)
}) })
it('should handle an showMessage statement definition', function () { it('should handle an showMessage statement definition', function () {
var str = 'info\nshowInfo' const str = 'info\nshowInfo'
parser.parse(str) parser.parse(str)
}) })
}) })

View File

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

View File

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

File diff suppressed because it is too large Load Diff