Fixed linter warnings

This commit is contained in:
Ron Buckton
2016-02-23 16:36:02 -08:00
parent 608822d93f
commit c9f52535f8
3 changed files with 5 additions and 15 deletions

View File

@@ -288,11 +288,6 @@ namespace ts {
}
export function emitFiles(resolver: EmitResolver, host: EmitHost, targetSourceFile: SourceFile): EmitResult {
return printFiles(resolver, host, targetSourceFile);
}
// targetSourceFile is when users only want one file in entire project to be emitted. This is used in compileOnSave feature
export function legacyEmitFiles(resolver: EmitResolver, host: EmitHost, targetSourceFile: SourceFile): EmitResult {
// emit output for the __extends helper function
const extendsHelper = `
var __extends = (this && this.__extends) || function (d, b) {

View File

@@ -743,7 +743,7 @@ namespace ts {
export function createJsxCreateElement(reactNamespace: string, tagName: Expression, props: Expression, children: Expression[]): LeftHandSideExpression {
const argumentsList = [tagName];
if (props) {
argumentsList.push(props)
argumentsList.push(props);
}
if (children && children.length > 0) {

View File

@@ -40,7 +40,7 @@ namespace ts {
function transformJsxChildToExpression(node: JsxChild): Expression {
switch (node.kind) {
case SyntaxKind.JsxText:
return visitNonEmptyJsxText(<JsxText>node);
return visitJsxText(<JsxText>node);
case SyntaxKind.JsxExpression:
return visitJsxExpression(<JsxExpression>node);
@@ -69,7 +69,7 @@ namespace ts {
let objectProperties: Expression;
if (node.attributes.length === 0) {
// When there are no attributes, React wants "null"
objectProperties = createLiteral(null);
objectProperties = createNull();
}
else {
// Either emit one big object literal (no spread attribs), or
@@ -124,7 +124,7 @@ namespace ts {
return createPropertyAssignment(name, expression);
}
function visitNonEmptyJsxText(node: JsxText) {
function visitJsxText(node: JsxText) {
const text = getTextToEmit(node);
if (text !== undefined) {
return createLiteral(text);
@@ -155,7 +155,7 @@ namespace ts {
const c = text.charCodeAt(i);
if (isLineBreak(c)) {
if (firstNonWhitespace !== -1 && (lastNonWhitespace - firstNonWhitespace + 1 > 0)) {
let part = text.substr(firstNonWhitespace, lastNonWhitespace - firstNonWhitespace + 1);
const part = text.substr(firstNonWhitespace, lastNonWhitespace - firstNonWhitespace + 1);
result = (result ? result + "\" + ' ' + \"" : "") + part;
}
firstNonWhitespace = -1;
@@ -218,11 +218,6 @@ namespace ts {
}
}
function visitJsxText(node: JsxText) {
const text = trimReactWhitespaceAndApplyEntities(node);
return createLiteral(text || "");
}
function visitJsxExpression(node: JsxExpression) {
return visitNode(node.expression, visitor, isExpression);
}