Skip to content

Commit a04bcec

Browse files
committed
Update TypeScript compiler, linter, and formatter to the latest version
Some formatting tweaks and identifier renaming (to adhere to the variable unshadowing rule) are necessary. Closes jquerygh-1906
1 parent 819c265 commit a04bcec

File tree

5 files changed

+24
-24
lines changed

5 files changed

+24
-24
lines changed

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,9 @@
5959
"temp": "~0.8.3",
6060
"test262": "git+https://[email protected]/tc39/test262.git#c4e3d12",
6161
"test262-stream": "~1.0.0",
62-
"tslint": "~5.1.0",
63-
"typescript": "~2.3.2",
64-
"typescript-formatter": "~5.1.3",
62+
"tslint": "~5.8.0",
63+
"typescript": "~2.6.2",
64+
"typescript-formatter": "~7.0.1",
6565
"unicode-8.0.0": "~0.7.0",
6666
"webpack": "~1.14.0"
6767
},

src/comment-handler.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -66,12 +66,12 @@ export class CommentHandler {
6666
return trailingComments;
6767
}
6868

69-
const entry = this.stack[this.stack.length - 1];
70-
if (entry && entry.node.trailingComments) {
71-
const firstComment = entry.node.trailingComments[0];
69+
const last = this.stack[this.stack.length - 1];
70+
if (last && last.node.trailingComments) {
71+
const firstComment = last.node.trailingComments[0];
7272
if (firstComment && firstComment.range[0] >= metadata.end.offset) {
73-
trailingComments = entry.node.trailingComments;
74-
delete entry.node.trailingComments;
73+
trailingComments = last.node.trailingComments;
74+
delete last.node.trailingComments;
7575
}
7676
}
7777
return trailingComments;

src/jsx-parser.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -484,9 +484,9 @@ export class JSXParser extends Parser {
484484
this.expectJSX('<');
485485
if (this.matchJSX('/')) {
486486
this.expectJSX('/');
487-
const name = this.parseJSXElementName();
487+
const elementName = this.parseJSXElementName();
488488
this.expectJSX('>');
489-
return this.finalize(node, new JSXNode.JSXClosingElement(name));
489+
return this.finalize(node, new JSXNode.JSXClosingElement(elementName));
490490
}
491491

492492
const name = this.parseJSXElementName();

src/scanner.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -877,11 +877,11 @@ export class Scanner {
877877
++this.index;
878878
str += this.scanUnicodeCodePointEscape();
879879
} else {
880-
const unescaped = this.scanHexEscape(ch);
881-
if (unescaped === null) {
880+
const unescapedChar = this.scanHexEscape(ch);
881+
if (unescapedChar === null) {
882882
this.throwUnexpectedToken();
883883
}
884-
str += unescaped;
884+
str += unescapedChar;
885885
}
886886
break;
887887
case 'x':
@@ -1003,9 +1003,9 @@ export class Scanner {
10031003
cooked += this.scanUnicodeCodePointEscape();
10041004
} else {
10051005
const restore = this.index;
1006-
const unescaped = this.scanHexEscape(ch);
1007-
if (unescaped !== null) {
1008-
cooked += unescaped;
1006+
const unescapedChar = this.scanHexEscape(ch);
1007+
if (unescapedChar !== null) {
1008+
cooked += unescapedChar;
10091009
} else {
10101010
this.index = restore;
10111011
cooked += ch;

test/test-262.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -82,26 +82,26 @@ function report(summary) {
8282
{
8383
tests: summary.disallowed.success,
8484
label:
85-
'valid programs parsed without error' +
86-
' (in violation of the whitelist file)'
85+
'valid programs parsed without error' +
86+
' (in violation of the whitelist file)'
8787
},
8888
{
8989
tests: summary.disallowed.failure,
9090
label:
91-
'invalid programs produced a parsing error' +
92-
' (in violation of the whitelist file)'
91+
'invalid programs produced a parsing error' +
92+
' (in violation of the whitelist file)'
9393
},
9494
{
9595
tests: summary.disallowed.falsePositive,
9696
label:
97-
'invalid programs did not produce a parsing error' +
98-
' (without a corresponding entry in the whitelist file)'
97+
'invalid programs did not produce a parsing error' +
98+
' (without a corresponding entry in the whitelist file)'
9999
},
100100
{
101101
tests: summary.disallowed.falseNegative,
102102
label:
103-
'valid programs produced a parsing error' +
104-
' (without a corresponding entry in the whitelist file)'
103+
'valid programs produced a parsing error' +
104+
' (without a corresponding entry in the whitelist file)'
105105
},
106106
{
107107
tests: summary.unrecognized,

0 commit comments

Comments
 (0)