refactor(): use const and let instead of var
This commit is contained in:

committed by
Victor Berchet

parent
73593d4bf3
commit
77ee27c59e
@ -9,9 +9,9 @@
|
||||
import {getIntParameter, getStringParameter, bindAction} from '@angular/testing/src/benchmark_util';
|
||||
declare var angular: any;
|
||||
|
||||
var totalRows = getIntParameter('rows');
|
||||
var totalColumns = getIntParameter('columns');
|
||||
var benchmarkType = getStringParameter('benchmarkType');
|
||||
const totalRows = getIntParameter('rows');
|
||||
const totalColumns = getIntParameter('columns');
|
||||
const benchmarkType = getStringParameter('benchmarkType');
|
||||
|
||||
export function main() {
|
||||
angular.bootstrap(document.querySelector('largetable'), ['app']);
|
||||
@ -45,14 +45,14 @@ angular.module('app', [])
|
||||
$scope.$apply(function() { $scope.benchmarkType = benchmarkType; });
|
||||
}
|
||||
|
||||
var data = $scope.data = [];
|
||||
const data = $scope.data = [];
|
||||
|
||||
function iGetter() { return this.i; }
|
||||
function jGetter() { return this.j; }
|
||||
|
||||
for (var i = 0; i < totalRows; i++) {
|
||||
for (let i = 0; i < totalRows; i++) {
|
||||
data[i] = [];
|
||||
for (var j = 0; j < totalColumns; j++) {
|
||||
for (let j = 0; j < totalColumns; j++) {
|
||||
data[i][j] = {i: i, j: j, iFn: iGetter, jFn: jGetter};
|
||||
}
|
||||
}
|
||||
@ -62,8 +62,8 @@ angular.module('app', [])
|
||||
return {
|
||||
restrict: 'E',
|
||||
link: function($scope, $element) {
|
||||
var i, j, row, cell, comment;
|
||||
var template = document.createElement('span');
|
||||
let i, j, row, cell, comment;
|
||||
const template = document.createElement('span');
|
||||
template.setAttribute('ng-repeat', 'foo in foos');
|
||||
template.classList.add('ng-scope');
|
||||
template.appendChild(document.createElement('span'));
|
||||
@ -94,8 +94,8 @@ angular.module('app', [])
|
||||
return {
|
||||
restrict: 'E',
|
||||
link: function($scope, $element) {
|
||||
var i, j, row, cell, comment;
|
||||
var template = document.createElement('span');
|
||||
let i, j, row, cell, comment;
|
||||
const template = document.createElement('span');
|
||||
template.setAttribute('ng-repeat', 'foo in foos');
|
||||
template.classList.add('ng-scope');
|
||||
|
||||
|
Reference in New Issue
Block a user