refactor(): use const and let instead of var

This commit is contained in:
Joao Dias
2016-11-12 14:08:58 +01:00
committed by Victor Berchet
parent 73593d4bf3
commit 77ee27c59e
435 changed files with 4637 additions and 4663 deletions

View File

@ -251,7 +251,7 @@ export class BindingParser {
let securityContexts: SecurityContext[];
if (parts.length === 1) {
var partValue = parts[0];
const partValue = parts[0];
boundPropertyName = this._schemaRegistry.getMappedPropName(partValue);
securityContexts = calcPossibleSecurityContexts(
this._schemaRegistry, elementSelector, boundPropertyName, false);

View File

@ -122,8 +122,8 @@ export class TemplateParser {
htmlAstWithErrors: ParseTreeResult, component: CompileDirectiveMetadata, template: string,
directives: CompileDirectiveSummary[], pipes: CompilePipeSummary[], schemas: SchemaMetadata[],
templateUrl: string): TemplateParseResult {
var result: TemplateAst[];
var errors = htmlAstWithErrors.errors;
let result: TemplateAst[];
const errors = htmlAstWithErrors.errors;
if (htmlAstWithErrors.rootNodes.length > 0) {
const uniqDirectives = removeSummaryDuplicates(directives);
const uniqPipes = removeSummaryDuplicates(pipes);
@ -819,9 +819,9 @@ function createElementCssSelector(elementName: string, matchableAttrs: string[][
cssSelector.setElement(elNameNoNs);
for (let i = 0; i < matchableAttrs.length; i++) {
let attrName = matchableAttrs[i][0];
let attrNameNoNs = splitNsName(attrName)[1];
let attrValue = matchableAttrs[i][1];
const attrName = matchableAttrs[i][0];
const attrNameNoNs = splitNsName(attrName)[1];
const attrValue = matchableAttrs[i][1];
cssSelector.addAttribute(attrNameNoNs, attrValue);
if (attrName.toLowerCase() == CLASS_ATTR) {

View File

@ -21,13 +21,13 @@ const NG_NON_BINDABLE_ATTR = 'ngNonBindable';
const NG_PROJECT_AS = 'ngProjectAs';
export function preparseElement(ast: html.Element): PreparsedElement {
var selectAttr: string = null;
var hrefAttr: string = null;
var relAttr: string = null;
var nonBindable = false;
var projectAs: string = null;
let selectAttr: string = null;
let hrefAttr: string = null;
let relAttr: string = null;
let nonBindable = false;
let projectAs: string = null;
ast.attrs.forEach(attr => {
let lcAttrName = attr.name.toLowerCase();
const lcAttrName = attr.name.toLowerCase();
if (lcAttrName == NG_CONTENT_SELECT_ATTR) {
selectAttr = attr.value;
} else if (lcAttrName == LINK_STYLE_HREF_ATTR) {
@ -43,8 +43,8 @@ export function preparseElement(ast: html.Element): PreparsedElement {
}
});
selectAttr = normalizeNgContentSelect(selectAttr);
var nodeName = ast.name.toLowerCase();
var type = PreparsedElementType.OTHER;
const nodeName = ast.name.toLowerCase();
let type = PreparsedElementType.OTHER;
if (splitNsName(nodeName)[1] == NG_CONTENT_ELEMENT) {
type = PreparsedElementType.NG_CONTENT;
} else if (nodeName == STYLE_ELEMENT) {