mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-06-13 01:33:08 -05:00
CR feedback.
This commit is contained in:
@@ -23,10 +23,10 @@ module ts {
|
||||
|
||||
export interface StringSet extends Map<any> { }
|
||||
|
||||
export function forEach<T, U>(array: T[], callback: (element: T) => U): U {
|
||||
export function forEach<T, U>(array: T[], callback: (element: T, index: number) => U): U {
|
||||
if (array) {
|
||||
for (var i = 0, len = array.length; i < len; i++) {
|
||||
var result = callback(array[i]);
|
||||
var result = callback(array[i], i);
|
||||
if (result) {
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -419,8 +419,9 @@ module ts {
|
||||
}
|
||||
|
||||
var ch = text.charCodeAt(pos);
|
||||
var len = text.length;
|
||||
|
||||
if (ch === CharacterCodes.lessThan || ch === CharacterCodes.greaterThan) {
|
||||
var len = text.length;
|
||||
while (pos < len && !isLineBreak(text.charCodeAt(pos))) {
|
||||
pos++;
|
||||
}
|
||||
@@ -429,7 +430,6 @@ module ts {
|
||||
Debug.assert(ch === CharacterCodes.equals);
|
||||
// Consume everything from the start of the mid-conlict marker to the start of the next
|
||||
// end-conflict marker.
|
||||
var len = text.length;
|
||||
while (pos < len) {
|
||||
var ch = text.charCodeAt(pos);
|
||||
if (ch === CharacterCodes.greaterThan && isConflictMarkerTrivia(text, pos)) {
|
||||
|
||||
@@ -16,6 +16,8 @@ module ts {
|
||||
MultiLineCommentTrivia,
|
||||
NewLineTrivia,
|
||||
WhitespaceTrivia,
|
||||
// We detect and provide better error recovery when we encounter a git merge marker. This
|
||||
// allows us to edit files with git-conflict markers in them in a much more pleasant manner.
|
||||
ConflictMarkerTrivia,
|
||||
// Literals
|
||||
NumericLiteral,
|
||||
|
||||
Reference in New Issue
Block a user