Avoid unnecessary allocations in binary expression emit.
This commit is contained in:
parent
8e292a19f7
commit
09c0c17937
|
@ -3088,52 +3088,15 @@ module ts {
|
|||
|
||||
write(tokenToString(node.operatorToken.kind));
|
||||
|
||||
// We'd like to preserve newlines found in the original binary expression. i.e. if a user has:
|
||||
//
|
||||
// Foo() ||
|
||||
// Bar();
|
||||
//
|
||||
// Then we'd like to emit it as such. It seems like we'd only need to check for a newline and
|
||||
// then just indent and emit. However, that will lead to a problem with deeply nested code.
|
||||
// i.e. if you have:
|
||||
//
|
||||
// Foo() ||
|
||||
// Bar() ||
|
||||
// Baz();
|
||||
//
|
||||
// Then we don't want to emit it as:
|
||||
//
|
||||
// Foo() ||
|
||||
// Bar() ||
|
||||
// Baz();
|
||||
//
|
||||
// So we only indent if the right side of the binary expression starts further in on the line
|
||||
// versus the left.
|
||||
|
||||
// Check if the right expression is on a different line versus the operator itself. If so,
|
||||
// we'll emit newline.
|
||||
if (!nodeEndIsOnSameLineAsNodeStart(node.operatorToken, node.right)) {
|
||||
var rightStart = getLineAndCharacterOfPosition(currentSourceFile, skipTrivia(currentSourceFile.text, node.right.pos));
|
||||
|
||||
// Also, if the right expression starts further in on the line than the left, then we'll indent.
|
||||
var exprStart = getLineAndCharacterOfPosition(currentSourceFile, skipTrivia(currentSourceFile.text, node.pos));
|
||||
var firstCharOfExpr = getFirstNonWhitespaceCharacterIndexOnLine(exprStart.line);
|
||||
var shouldIndent = rightStart.character > firstCharOfExpr;
|
||||
|
||||
if (shouldIndent) {
|
||||
increaseIndent();
|
||||
}
|
||||
|
||||
increaseIndent();
|
||||
writeLine();
|
||||
emit(node.right);
|
||||
decreaseIndent();
|
||||
}
|
||||
else {
|
||||
write(" ");
|
||||
}
|
||||
|
||||
emit(node.right);
|
||||
|
||||
if (shouldIndent) {
|
||||
decreaseIndent();
|
||||
emit(node.right);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -13,7 +13,7 @@ obj[Symbol.foo];
|
|||
//// [ES5SymbolProperty1.js]
|
||||
var Symbol;
|
||||
var obj = (_a = {}, _a[Symbol.foo] =
|
||||
0,
|
||||
_a);
|
||||
0,
|
||||
_a);
|
||||
obj[Symbol.foo];
|
||||
var _a;
|
||||
|
|
|
@ -3,6 +3,6 @@ var v = { [yield]: foo }
|
|||
|
||||
//// [FunctionDeclaration8_es6.js]
|
||||
var v = (_a = {}, _a[yield] =
|
||||
foo,
|
||||
_a);
|
||||
foo,
|
||||
_a);
|
||||
var _a;
|
||||
|
|
|
@ -6,7 +6,7 @@ function * foo() {
|
|||
//// [FunctionDeclaration9_es6.js]
|
||||
function foo() {
|
||||
var v = (_a = {}, _a[] =
|
||||
foo,
|
||||
_a);
|
||||
foo,
|
||||
_a);
|
||||
var _a;
|
||||
}
|
||||
|
|
|
@ -3,5 +3,5 @@ var v = { *[foo()]() { } }
|
|||
|
||||
//// [FunctionPropertyAssignments5_es6.js]
|
||||
var v = (_a = {}, _a[foo()] = function () { },
|
||||
_a);
|
||||
_a);
|
||||
var _a;
|
||||
|
|
|
@ -38,8 +38,8 @@ y
|
|||
var x = 1;
|
||||
var y = 1;
|
||||
var z = x +
|
||||
+ +y;
|
||||
+ +y;
|
||||
var a = 1;
|
||||
var b = 1;
|
||||
var c = x -
|
||||
- -y;
|
||||
- -y;
|
||||
|
|
|
@ -21,5 +21,5 @@ var s;
|
|||
var n;
|
||||
var a;
|
||||
var v = (_a = {}, _a[s] = function () { }, _a[n] = function () { }, _a[s + s] = function () { }, _a[s + n] = function () { }, _a[+s] = function () { }, _a[""] = function () { }, _a[0] = function () { }, _a[a] = function () { }, _a[true] = function () { }, _a["hello bye"] = function () { }, _a["hello " + a + " bye"] = function () { },
|
||||
_a);
|
||||
_a);
|
||||
var _a;
|
||||
|
|
|
@ -21,5 +21,5 @@ var s;
|
|||
var n;
|
||||
var a;
|
||||
var v = (_a = {}, _a[s] = Object.defineProperty({ get: function () { return 0; }, enumerable: true, configurable: true }), _a[n] = Object.defineProperty({ set: function (v) { }, enumerable: true, configurable: true }), _a[s + s] = Object.defineProperty({ get: function () { return 0; }, enumerable: true, configurable: true }), _a[s + n] = Object.defineProperty({ set: function (v) { }, enumerable: true, configurable: true }), _a[+s] = Object.defineProperty({ get: function () { return 0; }, enumerable: true, configurable: true }), _a[""] = Object.defineProperty({ set: function (v) { }, enumerable: true, configurable: true }), _a[0] = Object.defineProperty({ get: function () { return 0; }, enumerable: true, configurable: true }), _a[a] = Object.defineProperty({ set: function (v) { }, enumerable: true, configurable: true }), _a[true] = Object.defineProperty({ get: function () { return 0; }, enumerable: true, configurable: true }), _a["hello bye"] = Object.defineProperty({ set: function (v) { }, enumerable: true, configurable: true }), _a["hello " + a + " bye"] = Object.defineProperty({ get: function () { return 0; }, enumerable: true, configurable: true }),
|
||||
_a);
|
||||
_a);
|
||||
var _a;
|
||||
|
|
|
@ -8,7 +8,7 @@ function foo() {
|
|||
//// [computedPropertyNames18_ES5.js]
|
||||
function foo() {
|
||||
var obj = (_a = {}, _a[this.bar] =
|
||||
0,
|
||||
_a);
|
||||
0,
|
||||
_a);
|
||||
var _a;
|
||||
}
|
||||
|
|
|
@ -9,7 +9,7 @@ module M {
|
|||
var M;
|
||||
(function (M) {
|
||||
var obj = (_a = {}, _a[this.bar] =
|
||||
0,
|
||||
_a);
|
||||
0,
|
||||
_a);
|
||||
var _a;
|
||||
})(M || (M = {}));
|
||||
|
|
|
@ -6,5 +6,5 @@ var v = {
|
|||
|
||||
//// [computedPropertyNames1_ES5.js]
|
||||
var v = (_a = {}, _a[0 + 1] = Object.defineProperty({ get: function () { return 0; }, enumerable: true, configurable: true }), _a[0 + 1] = Object.defineProperty({ set: function (v) { }, enumerable: true, configurable: true }),
|
||||
_a);
|
||||
_a);
|
||||
var _a;
|
||||
|
|
|
@ -5,6 +5,6 @@ var obj = {
|
|||
|
||||
//// [computedPropertyNames20_ES5.js]
|
||||
var obj = (_a = {}, _a[this.bar] =
|
||||
0,
|
||||
_a);
|
||||
0,
|
||||
_a);
|
||||
var _a;
|
||||
|
|
|
@ -14,7 +14,7 @@ var C = (function () {
|
|||
}
|
||||
C.prototype.bar = function () {
|
||||
var obj = (_a = {}, _a[this.bar()] = function () { },
|
||||
_a);
|
||||
_a);
|
||||
return 0;
|
||||
var _a;
|
||||
};
|
||||
|
|
|
@ -16,8 +16,8 @@ var C = (function () {
|
|||
return 0;
|
||||
};
|
||||
C.prototype[(_a = {}, _a[this.bar()] =
|
||||
1,
|
||||
_a)[0]] = function () { };
|
||||
1,
|
||||
_a)[0]] = function () { };
|
||||
return C;
|
||||
})();
|
||||
var _a;
|
||||
|
|
|
@ -35,7 +35,7 @@ var C = (function (_super) {
|
|||
}
|
||||
C.prototype.foo = function () {
|
||||
var obj = (_a = {}, _a[_super.prototype.bar.call(this)] = function () { },
|
||||
_a);
|
||||
_a);
|
||||
return 0;
|
||||
var _a;
|
||||
};
|
||||
|
|
|
@ -35,8 +35,8 @@ var C = (function (_super) {
|
|||
// Gets emitted as super, not _super, which is consistent with
|
||||
// use of super in static properties initializers.
|
||||
C.prototype[(_a = {}, _a[super.bar.call(this)] =
|
||||
1,
|
||||
_a)[0]] = function () { };
|
||||
1,
|
||||
_a)[0]] = function () { };
|
||||
return C;
|
||||
})(Base);
|
||||
var _a;
|
||||
|
|
|
@ -27,7 +27,7 @@ var C = (function (_super) {
|
|||
function C() {
|
||||
_super.call(this);
|
||||
var obj = (_a = {}, _a[(_super.call(this), "prop")] = function () { },
|
||||
_a);
|
||||
_a);
|
||||
var _a;
|
||||
}
|
||||
return C;
|
||||
|
|
|
@ -18,7 +18,7 @@ var C = (function () {
|
|||
var _this = this;
|
||||
(function () {
|
||||
var obj = (_a = {}, _a[_this.bar()] = function () { },
|
||||
_a);
|
||||
_a);
|
||||
var _a;
|
||||
});
|
||||
return 0;
|
||||
|
|
|
@ -33,7 +33,7 @@ var C = (function (_super) {
|
|||
_super.call(this);
|
||||
(function () {
|
||||
var obj = (_a = {}, _a[(_super.call(this), "prop")] = function () { },
|
||||
_a);
|
||||
_a);
|
||||
var _a;
|
||||
});
|
||||
}
|
||||
|
|
|
@ -39,7 +39,7 @@ var C = (function (_super) {
|
|||
var _this = this;
|
||||
(function () {
|
||||
var obj = (_a = {}, _a[_super.prototype.bar.call(_this)] = function () { },
|
||||
_a);
|
||||
_a);
|
||||
var _a;
|
||||
});
|
||||
return 0;
|
||||
|
|
|
@ -16,7 +16,7 @@ var C = (function () {
|
|||
}
|
||||
C.prototype.bar = function () {
|
||||
var obj = (_a = {}, _a[foo()] = function () { },
|
||||
_a);
|
||||
_a);
|
||||
return 0;
|
||||
var _a;
|
||||
};
|
||||
|
|
|
@ -16,7 +16,7 @@ var C = (function () {
|
|||
}
|
||||
C.bar = function () {
|
||||
var obj = (_a = {}, _a[foo()] = function () { },
|
||||
_a);
|
||||
_a);
|
||||
return 0;
|
||||
var _a;
|
||||
};
|
||||
|
|
|
@ -5,6 +5,6 @@ var o = {
|
|||
|
||||
//// [computedPropertyNames46_ES5.js]
|
||||
var o = (_a = {}, _a["" || 0] =
|
||||
0,
|
||||
_a);
|
||||
0,
|
||||
_a);
|
||||
var _a;
|
||||
|
|
|
@ -15,6 +15,6 @@ var E2;
|
|||
E2[E2["x"] = 0] = "x";
|
||||
})(E2 || (E2 = {}));
|
||||
var o = (_a = {}, _a[0 /* x */ || 0 /* x */] =
|
||||
0,
|
||||
_a);
|
||||
0,
|
||||
_a);
|
||||
var _a;
|
||||
|
|
|
@ -24,12 +24,12 @@ var E;
|
|||
})(E || (E = {}));
|
||||
var a;
|
||||
extractIndexer((_a = {}, _a[a] =
|
||||
"",
|
||||
_a)); // Should return string
|
||||
"",
|
||||
_a)); // Should return string
|
||||
extractIndexer((_b = {}, _b[0 /* x */] =
|
||||
"",
|
||||
_b)); // Should return string
|
||||
"",
|
||||
_b)); // Should return string
|
||||
extractIndexer((_c = {}, _c["" || 0] =
|
||||
"",
|
||||
_c)); // Should return any (widened form of undefined)
|
||||
"",
|
||||
_c)); // Should return any (widened form of undefined)
|
||||
var _a, _b, _c;
|
||||
|
|
|
@ -29,7 +29,7 @@ var x = {
|
|||
var x = (_a = {
|
||||
p1: 10
|
||||
}, _a.p1 =
|
||||
10, _a[1 + 1] = Object.defineProperty({ get: function () {
|
||||
10, _a[1 + 1] = Object.defineProperty({ get: function () {
|
||||
throw 10;
|
||||
}, enumerable: true, configurable: true }), _a[1 + 1] = Object.defineProperty({ get: function () {
|
||||
return 10;
|
||||
|
@ -41,6 +41,6 @@ var x = (_a = {
|
|||
return 10;
|
||||
}
|
||||
}, enumerable: true, configurable: true }), _a.p2 =
|
||||
20,
|
||||
_a);
|
||||
20,
|
||||
_a);
|
||||
var _a;
|
||||
|
|
|
@ -21,16 +21,16 @@ var s;
|
|||
var n;
|
||||
var a;
|
||||
var v = (_a = {}, _a[s] =
|
||||
0, _a[n] =
|
||||
n, _a[s + s] =
|
||||
1, _a[s + n] =
|
||||
2, _a[+s] =
|
||||
s, _a[""] =
|
||||
0, _a[0] =
|
||||
0, _a[a] =
|
||||
1, _a[true] =
|
||||
0, _a["hello bye"] =
|
||||
0, _a["hello " + a + " bye"] =
|
||||
0,
|
||||
_a);
|
||||
0, _a[n] =
|
||||
n, _a[s + s] =
|
||||
1, _a[s + n] =
|
||||
2, _a[+s] =
|
||||
s, _a[""] =
|
||||
0, _a[0] =
|
||||
0, _a[a] =
|
||||
1, _a[true] =
|
||||
0, _a["hello bye"] =
|
||||
0, _a["hello " + a + " bye"] =
|
||||
0,
|
||||
_a);
|
||||
var _a;
|
||||
|
|
|
@ -34,7 +34,7 @@ var x = (_a = {
|
|||
}
|
||||
}
|
||||
}, _a.p1 =
|
||||
10, _a.foo = Object.defineProperty({ get: function () {
|
||||
10, _a.foo = Object.defineProperty({ get: function () {
|
||||
if (1 == 1) {
|
||||
return 10;
|
||||
}
|
||||
|
@ -46,6 +46,6 @@ var x = (_a = {
|
|||
}, enumerable: true, configurable: true }), _a[1 + 1] = Object.defineProperty({ get: function () {
|
||||
return 10;
|
||||
}, enumerable: true, configurable: true }), _a.p2 =
|
||||
20,
|
||||
_a);
|
||||
20,
|
||||
_a);
|
||||
var _a;
|
||||
|
|
|
@ -12,11 +12,11 @@ var v = {
|
|||
//// [computedPropertyNames5_ES5.js]
|
||||
var b;
|
||||
var v = (_a = {}, _a[b] =
|
||||
0, _a[true] =
|
||||
1, _a[[]] =
|
||||
0, _a[{}] =
|
||||
0, _a[undefined] =
|
||||
undefined, _a[null] =
|
||||
null,
|
||||
_a);
|
||||
0, _a[true] =
|
||||
1, _a[[]] =
|
||||
0, _a[{}] =
|
||||
0, _a[undefined] =
|
||||
undefined, _a[null] =
|
||||
null,
|
||||
_a);
|
||||
var _a;
|
||||
|
|
|
@ -13,8 +13,8 @@ var p1;
|
|||
var p2;
|
||||
var p3;
|
||||
var v = (_a = {}, _a[p1] =
|
||||
0, _a[p2] =
|
||||
1, _a[p3] =
|
||||
2,
|
||||
_a);
|
||||
0, _a[p2] =
|
||||
1, _a[p3] =
|
||||
2,
|
||||
_a);
|
||||
var _a;
|
||||
|
|
|
@ -12,6 +12,6 @@ var E;
|
|||
E[E["member"] = 0] = "member";
|
||||
})(E || (E = {}));
|
||||
var v = (_a = {}, _a[0 /* member */] =
|
||||
0,
|
||||
_a);
|
||||
0,
|
||||
_a);
|
||||
var _a;
|
||||
|
|
|
@ -13,8 +13,8 @@ function f() {
|
|||
var t;
|
||||
var u;
|
||||
var v = (_a = {}, _a[t] =
|
||||
0, _a[u] =
|
||||
1,
|
||||
_a);
|
||||
0, _a[u] =
|
||||
1,
|
||||
_a);
|
||||
var _a;
|
||||
}
|
||||
|
|
|
@ -13,8 +13,8 @@ var v = {
|
|||
//// [computedPropertyNames9_ES5.js]
|
||||
function f(x) { }
|
||||
var v = (_a = {}, _a[f("")] =
|
||||
0, _a[f(0)] =
|
||||
0, _a[f(true)] =
|
||||
0,
|
||||
_a);
|
||||
0, _a[f(0)] =
|
||||
0, _a[f(true)] =
|
||||
0,
|
||||
_a);
|
||||
var _a;
|
||||
|
|
|
@ -10,7 +10,7 @@ var o: I = {
|
|||
|
||||
//// [computedPropertyNamesContextualType10_ES5.js]
|
||||
var o = (_a = {}, _a[+"foo"] =
|
||||
"", _a[+"bar"] =
|
||||
0,
|
||||
_a);
|
||||
"", _a[+"bar"] =
|
||||
0,
|
||||
_a);
|
||||
var _a;
|
||||
|
|
|
@ -11,6 +11,6 @@ var o: I = {
|
|||
|
||||
//// [computedPropertyNamesContextualType1_ES5.js]
|
||||
var o = (_a = {}, _a["" + 0] = function (y) { return y.length; }, _a["" + 1] =
|
||||
function (y) { return y.length; },
|
||||
_a);
|
||||
function (y) { return y.length; },
|
||||
_a);
|
||||
var _a;
|
||||
|
|
|
@ -11,6 +11,6 @@ var o: I = {
|
|||
|
||||
//// [computedPropertyNamesContextualType2_ES5.js]
|
||||
var o = (_a = {}, _a[+"foo"] = function (y) { return y.length; }, _a[+"bar"] =
|
||||
function (y) { return y.length; },
|
||||
_a);
|
||||
function (y) { return y.length; },
|
||||
_a);
|
||||
var _a;
|
||||
|
|
|
@ -10,6 +10,6 @@ var o: I = {
|
|||
|
||||
//// [computedPropertyNamesContextualType3_ES5.js]
|
||||
var o = (_a = {}, _a[+"foo"] = function (y) { return y.length; }, _a[+"bar"] =
|
||||
function (y) { return y.length; },
|
||||
_a);
|
||||
function (y) { return y.length; },
|
||||
_a);
|
||||
var _a;
|
||||
|
|
|
@ -11,7 +11,7 @@ var o: I = {
|
|||
|
||||
//// [computedPropertyNamesContextualType4_ES5.js]
|
||||
var o = (_a = {}, _a["" + "foo"] =
|
||||
"", _a["" + "bar"] =
|
||||
0,
|
||||
_a);
|
||||
"", _a["" + "bar"] =
|
||||
0,
|
||||
_a);
|
||||
var _a;
|
||||
|
|
|
@ -11,7 +11,7 @@ var o: I = {
|
|||
|
||||
//// [computedPropertyNamesContextualType5_ES5.js]
|
||||
var o = (_a = {}, _a[+"foo"] =
|
||||
"", _a[+"bar"] =
|
||||
0,
|
||||
_a);
|
||||
"", _a[+"bar"] =
|
||||
0,
|
||||
_a);
|
||||
var _a;
|
||||
|
|
|
@ -18,10 +18,10 @@ foo((_a = {
|
|||
p: "",
|
||||
0: function () { }
|
||||
}, _a.p =
|
||||
"", _a[0] =
|
||||
function () { }, _a["hi" + "bye"] =
|
||||
true, _a[0 + 1] =
|
||||
0, _a[+"hi"] =
|
||||
[0],
|
||||
_a));
|
||||
"", _a[0] =
|
||||
function () { }, _a["hi" + "bye"] =
|
||||
true, _a[0 + 1] =
|
||||
0, _a[+"hi"] =
|
||||
[0],
|
||||
_a));
|
||||
var _a;
|
||||
|
|
|
@ -18,10 +18,10 @@ foo((_a = {
|
|||
p: "",
|
||||
0: function () { }
|
||||
}, _a.p =
|
||||
"", _a[0] =
|
||||
function () { }, _a["hi" + "bye"] =
|
||||
true, _a[0 + 1] =
|
||||
0, _a[+"hi"] =
|
||||
[0],
|
||||
_a));
|
||||
"", _a[0] =
|
||||
function () { }, _a["hi" + "bye"] =
|
||||
true, _a[0 + 1] =
|
||||
0, _a[+"hi"] =
|
||||
[0],
|
||||
_a));
|
||||
var _a;
|
||||
|
|
|
@ -11,7 +11,7 @@ var o: I = {
|
|||
|
||||
//// [computedPropertyNamesContextualType8_ES5.js]
|
||||
var o = (_a = {}, _a["" + "foo"] =
|
||||
"", _a["" + "bar"] =
|
||||
0,
|
||||
_a);
|
||||
"", _a["" + "bar"] =
|
||||
0,
|
||||
_a);
|
||||
var _a;
|
||||
|
|
|
@ -11,7 +11,7 @@ var o: I = {
|
|||
|
||||
//// [computedPropertyNamesContextualType9_ES5.js]
|
||||
var o = (_a = {}, _a[+"foo"] =
|
||||
"", _a[+"bar"] =
|
||||
0,
|
||||
_a);
|
||||
"", _a[+"bar"] =
|
||||
0,
|
||||
_a);
|
||||
var _a;
|
||||
|
|
|
@ -8,8 +8,8 @@ var v = {
|
|||
|
||||
//// [computedPropertyNamesDeclarationEmit5_ES5.js]
|
||||
var v = (_a = {}, _a["" + ""] =
|
||||
0, _a["" + ""] = function () { }, _a["" + ""] = Object.defineProperty({ get: function () { return 0; }, enumerable: true, configurable: true }), _a["" + ""] = Object.defineProperty({ set: function (x) { }, enumerable: true, configurable: true }),
|
||||
_a);
|
||||
0, _a["" + ""] = function () { }, _a["" + ""] = Object.defineProperty({ get: function () { return 0; }, enumerable: true, configurable: true }), _a["" + ""] = Object.defineProperty({ set: function (x) { }, enumerable: true, configurable: true }),
|
||||
_a);
|
||||
var _a;
|
||||
|
||||
|
||||
|
|
|
@ -9,6 +9,6 @@ var v = {
|
|||
var v = (_a = {}, _a["hello"] = function () {
|
||||
debugger;
|
||||
},
|
||||
_a);
|
||||
_a);
|
||||
var _a;
|
||||
//# sourceMappingURL=computedPropertyNamesSourceMap2_ES5.js.map
|
|
@ -1,2 +1,2 @@
|
|||
//// [computedPropertyNamesSourceMap2_ES5.js.map]
|
||||
{"version":3,"file":"computedPropertyNamesSourceMap2_ES5.js","sourceRoot":"","sources":["computedPropertyNamesSourceMap2_ES5.ts"],"names":[],"mappings":"AAAA,IAAI,CAAC,GAAG,AADA,CACA,EAAA,GADA,EAAA,EACA,EAAA,CACK,OAAO,CAFA,GAAA;IAGA,QAAQ,CAAC;AACb,CAAC,AAJA;AACA,EAAA,AADA,CAKA,CAAA;IAJD,EAAA"}
|
||||
{"version":3,"file":"computedPropertyNamesSourceMap2_ES5.js","sourceRoot":"","sources":["computedPropertyNamesSourceMap2_ES5.ts"],"names":[],"mappings":"AAAA,IAAI,CAAC,GAAG,AADA,CACA,EAAA,GADA,EAAA,EACA,EAAA,CACK,OAAO,CAFA,GAAA;IAGA,QAAQ,CAAC;AACb,CAAC,AAJA;IACA,EAAA,AADA,CAKA,CAAA;IAJD,EAAA"}
|
|
@ -99,7 +99,7 @@ sourceFile:computedPropertyNamesSourceMap2_ES5.ts
|
|||
1 >
|
||||
2 >^
|
||||
3 >
|
||||
4 > ^^^^->
|
||||
4 > ^^^^^^^^->
|
||||
1 >!!^^ !!^^ There was decoding error in the sourcemap at this location: Invalid sourceLine found
|
||||
1 >!!^^ !!^^ Decoded span from sourcemap's mappings entry: Emitted(1, 33) Source(0, 21) + SourceIndex(0) nameIndex (-1) Span encoded by the emitter:Emitted(3, 1) Source(4, 5) + SourceIndex(0) nameIndex (-1)
|
||||
1 >
|
||||
|
@ -114,45 +114,44 @@ sourceFile:computedPropertyNamesSourceMap2_ES5.ts
|
|||
2 >Emitted(3, 2) Source(4, 6) + SourceIndex(0)
|
||||
3 >Emitted(3, 2) Source(0, NaN) + SourceIndex(0)
|
||||
---
|
||||
>>>_a);
|
||||
1->
|
||||
2 >^^
|
||||
3 >
|
||||
4 > ^
|
||||
5 > ^
|
||||
6 > ^^^^->
|
||||
1->!!^^ !!^^ The decoded span from sourcemap's mapping entry does not match what was encoded for this span:
|
||||
1->!!^^ !!^^ Decoded span from sourcemap's mappings entry: Emitted(2, 13) Source(3, 29) + SourceIndex(0) nameIndex (-1) Span encoded by the emitter:Emitted(4, 1) Source(1, 1) + SourceIndex(0) nameIndex (-1)
|
||||
1->
|
||||
2 >!!^^ !!^^ The decoded span from sourcemap's mapping entry does not match what was encoded for this span:
|
||||
2 >!!^^ !!^^ Decoded span from sourcemap's mappings entry: Emitted(2, 14) Source(3, 30) + SourceIndex(0) nameIndex (-1) Span encoded by the emitter:Emitted(4, 3) Source(1, 1) + SourceIndex(0) nameIndex (-1)
|
||||
2 >
|
||||
3 > !!^^ !!^^ The decoded span from sourcemap's mapping entry does not match what was encoded for this span:
|
||||
3 > !!^^ !!^^ Decoded span from sourcemap's mappings entry: Emitted(3, 1) Source(4, 17) + SourceIndex(0) nameIndex (-1) Span encoded by the emitter:Emitted(4, 3) Source(0, NaN) + SourceIndex(0) nameIndex (-1)
|
||||
3 >
|
||||
4 > !!^^ !!^^ The decoded span from sourcemap's mapping entry does not match what was encoded for this span:
|
||||
4 > !!^^ !!^^ Decoded span from sourcemap's mappings entry: Emitted(3, 2) Source(4, 18) + SourceIndex(0) nameIndex (-1) Span encoded by the emitter:Emitted(4, 4) Source(5, 2) + SourceIndex(0) nameIndex (-1)
|
||||
4 >
|
||||
5 > !!^^ !!^^ There was decoding error in the sourcemap at this location: Invalid sourceLine found
|
||||
5 > !!^^ !!^^ Decoded span from sourcemap's mappings entry: Emitted(3, 2) Source(0, 18) + SourceIndex(0) nameIndex (-1) Span encoded by the emitter:Emitted(4, 5) Source(5, 2) + SourceIndex(0) nameIndex (-1)
|
||||
5 >
|
||||
1->Emitted(4, 1) Source(1, 1) + SourceIndex(0)
|
||||
2 >Emitted(4, 3) Source(1, 1) + SourceIndex(0)
|
||||
3 >Emitted(4, 3) Source(0, NaN) + SourceIndex(0)
|
||||
4 >Emitted(4, 4) Source(5, 2) + SourceIndex(0)
|
||||
5 >Emitted(4, 5) Source(5, 2) + SourceIndex(0)
|
||||
---
|
||||
>>>var _a;
|
||||
>>> _a);
|
||||
1->^^^^
|
||||
2 > ^^
|
||||
3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^->
|
||||
1->!!^^ !!^^ There was decoding error in the sourcemap at this location: Unsupported Error Format: No entries after emitted column
|
||||
1->!!^^ !!^^ Decoded span from sourcemap's mappings entry: Emitted(3, 2) Source(0, 18) + SourceIndex(0) nameIndex (-1) Span encoded by the emitter:Emitted(5, 5) Source(1, 1) + SourceIndex(0) nameIndex (-1)
|
||||
3 >
|
||||
4 > ^
|
||||
5 > ^
|
||||
1->!!^^ !!^^ The decoded span from sourcemap's mapping entry does not match what was encoded for this span:
|
||||
1->!!^^ !!^^ Decoded span from sourcemap's mappings entry: Emitted(2, 13) Source(3, 29) + SourceIndex(0) nameIndex (-1) Span encoded by the emitter:Emitted(4, 5) Source(1, 1) + SourceIndex(0) nameIndex (-1)
|
||||
1->
|
||||
2 > !!^^ !!^^ The decoded span from sourcemap's mapping entry does not match what was encoded for this span:
|
||||
2 > !!^^ !!^^ Decoded span from sourcemap's mappings entry: Emitted(4, 1) Source(1, 18) + SourceIndex(0) nameIndex (-1) Span encoded by the emitter:Emitted(5, 7) Source(1, 1) + SourceIndex(0) nameIndex (-1)
|
||||
2 > !!^^ !!^^ Decoded span from sourcemap's mappings entry: Emitted(2, 14) Source(3, 30) + SourceIndex(0) nameIndex (-1) Span encoded by the emitter:Emitted(4, 7) Source(1, 1) + SourceIndex(0) nameIndex (-1)
|
||||
2 >
|
||||
1->Emitted(5, 5) Source(1, 1) + SourceIndex(0)
|
||||
3 > !!^^ !!^^ The decoded span from sourcemap's mapping entry does not match what was encoded for this span:
|
||||
3 > !!^^ !!^^ Decoded span from sourcemap's mappings entry: Emitted(3, 1) Source(4, 17) + SourceIndex(0) nameIndex (-1) Span encoded by the emitter:Emitted(4, 7) Source(0, NaN) + SourceIndex(0) nameIndex (-1)
|
||||
3 >
|
||||
4 > !!^^ !!^^ The decoded span from sourcemap's mapping entry does not match what was encoded for this span:
|
||||
4 > !!^^ !!^^ Decoded span from sourcemap's mappings entry: Emitted(3, 2) Source(4, 18) + SourceIndex(0) nameIndex (-1) Span encoded by the emitter:Emitted(4, 8) Source(5, 2) + SourceIndex(0) nameIndex (-1)
|
||||
4 >
|
||||
5 > !!^^ !!^^ There was decoding error in the sourcemap at this location: Invalid sourceLine found
|
||||
5 > !!^^ !!^^ Decoded span from sourcemap's mappings entry: Emitted(3, 2) Source(0, 18) + SourceIndex(0) nameIndex (-1) Span encoded by the emitter:Emitted(4, 9) Source(5, 2) + SourceIndex(0) nameIndex (-1)
|
||||
5 >
|
||||
1->Emitted(4, 5) Source(1, 1) + SourceIndex(0)
|
||||
2 >Emitted(4, 7) Source(1, 1) + SourceIndex(0)
|
||||
3 >Emitted(4, 7) Source(0, NaN) + SourceIndex(0)
|
||||
4 >Emitted(4, 8) Source(5, 2) + SourceIndex(0)
|
||||
5 >Emitted(4, 9) Source(5, 2) + SourceIndex(0)
|
||||
---
|
||||
>>>var _a;
|
||||
1 >^^^^
|
||||
2 > ^^
|
||||
3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^->
|
||||
1 >!!^^ !!^^ There was decoding error in the sourcemap at this location: Unsupported Error Format: No entries after emitted column
|
||||
1 >!!^^ !!^^ Decoded span from sourcemap's mappings entry: Emitted(3, 2) Source(0, 18) + SourceIndex(0) nameIndex (-1) Span encoded by the emitter:Emitted(5, 5) Source(1, 1) + SourceIndex(0) nameIndex (-1)
|
||||
1 >
|
||||
2 > !!^^ !!^^ The decoded span from sourcemap's mapping entry does not match what was encoded for this span:
|
||||
2 > !!^^ !!^^ Decoded span from sourcemap's mappings entry: Emitted(4, 5) Source(1, 18) + SourceIndex(0) nameIndex (-1) Span encoded by the emitter:Emitted(5, 7) Source(1, 1) + SourceIndex(0) nameIndex (-1)
|
||||
2 >
|
||||
1 >Emitted(5, 5) Source(1, 1) + SourceIndex(0)
|
||||
2 >Emitted(5, 7) Source(1, 1) + SourceIndex(0)
|
||||
---
|
||||
!!!! **** There are more source map entries in the sourceMap's mapping than what was encoded
|
||||
|
|
|
@ -315,7 +315,7 @@ var TypeScriptAllInOne;
|
|||
if (retValue === void 0) { retValue = != 0; }
|
||||
return 1;
|
||||
^
|
||||
retValue;
|
||||
retValue;
|
||||
bfs.TYPES();
|
||||
if (retValue != 0) {
|
||||
return 1 &&
|
||||
|
@ -543,7 +543,7 @@ while ()
|
|||
rest: string[];
|
||||
{
|
||||
&
|
||||
public;
|
||||
public;
|
||||
DefaultValue(value ? : string = "Hello");
|
||||
{ }
|
||||
}
|
||||
|
|
|
@ -431,7 +431,7 @@ exports.tests = (function () {
|
|||
}));
|
||||
testRunner.addTest(new TestCase("Check binary file doesn't match", function () {
|
||||
return (!FileManager.FileBuffer.isTextFile("C:\\somedir\\app.exe") &&
|
||||
!FileManager.FileBuffer.isTextFile("C:\\somedir\\my lib.dll"));
|
||||
!FileManager.FileBuffer.isTextFile("C:\\somedir\\my lib.dll"));
|
||||
}));
|
||||
// Command-line parameter tests
|
||||
testRunner.addTest(new TestCase("Check App defaults", function () {
|
||||
|
|
|
@ -3,6 +3,6 @@ var v = { [e]: 1 };
|
|||
|
||||
//// [parserES5ComputedPropertyName2.js]
|
||||
var v = (_a = {}, _a[e] =
|
||||
1,
|
||||
_a);
|
||||
1,
|
||||
_a);
|
||||
var _a;
|
||||
|
|
|
@ -3,5 +3,5 @@ var v = { [e]() { } };
|
|||
|
||||
//// [parserES5ComputedPropertyName3.js]
|
||||
var v = (_a = {}, _a[e] = function () { },
|
||||
_a);
|
||||
_a);
|
||||
var _a;
|
||||
|
|
|
@ -3,5 +3,5 @@ var v = { get [e]() { } };
|
|||
|
||||
//// [parserES5ComputedPropertyName4.js]
|
||||
var v = (_a = {}, _a[e] = Object.defineProperty({ get: function () { }, enumerable: true, configurable: true }),
|
||||
_a);
|
||||
_a);
|
||||
var _a;
|
||||
|
|
|
@ -6,4 +6,4 @@
|
|||
|
||||
//// [parserGreaterThanTokenAmbiguity10.js]
|
||||
1 >>>
|
||||
2;
|
||||
2;
|
||||
|
|
|
@ -6,4 +6,4 @@
|
|||
|
||||
//// [parserGreaterThanTokenAmbiguity15.js]
|
||||
1 >>=
|
||||
2;
|
||||
2;
|
||||
|
|
|
@ -6,4 +6,4 @@
|
|||
|
||||
//// [parserGreaterThanTokenAmbiguity20.js]
|
||||
1 >>>=
|
||||
2;
|
||||
2;
|
||||
|
|
|
@ -6,4 +6,4 @@
|
|||
|
||||
//// [parserGreaterThanTokenAmbiguity5.js]
|
||||
1 >>
|
||||
2;
|
||||
2;
|
||||
|
|
|
@ -999,8 +999,8 @@ var TypeScript;
|
|||
// 0123
|
||||
// If "position == 3", the caret is at the "right" of the "r" character, which should be considered valid
|
||||
var inclusive = hasFlag(options, 1 /* EdgeInclusive */) ||
|
||||
cur.nodeType === TypeScript.NodeType.Name ||
|
||||
pos === script.limChar; // Special "EOF" case
|
||||
cur.nodeType === TypeScript.NodeType.Name ||
|
||||
pos === script.limChar; // Special "EOF" case
|
||||
var minChar = cur.minChar;
|
||||
var limChar = cur.limChar + (inclusive ? 1 : 0);
|
||||
if (pos >= minChar && pos < limChar) {
|
||||
|
|
|
@ -12,8 +12,8 @@ var y: {
|
|||
//// [privateIndexer2.js]
|
||||
// private indexers not allowed
|
||||
var x = (_a = {}, _a[x] =
|
||||
string, _a.string =
|
||||
string, _a.string =
|
||||
,
|
||||
_a);
|
||||
_a);
|
||||
var y;
|
||||
var _a;
|
||||
|
|
|
@ -7,5 +7,5 @@ var x = `abc${0}abc` === `abc` ||
|
|||
//// [templateStringInEqualityChecks.js]
|
||||
var x = "abc" + 0 + "abc" === "abc" ||
|
||||
"abc" !== "abc" + 0 + "abc" &&
|
||||
"abc" + 0 + "abc" == "abc0abc" &&
|
||||
"abc0abc" !== "abc" + 0 + "abc";
|
||||
"abc" + 0 + "abc" == "abc0abc" &&
|
||||
"abc0abc" !== "abc" + 0 + "abc";
|
||||
|
|
|
@ -7,5 +7,5 @@ var x = `abc${0}abc` === `abc` ||
|
|||
//// [templateStringInEqualityChecksES6.js]
|
||||
var x = `abc${0}abc` === `abc` ||
|
||||
`abc` !== `abc${0}abc` &&
|
||||
`abc${0}abc` == "abc0abc" &&
|
||||
"abc0abc" !== `abc${0}abc`;
|
||||
`abc${0}abc` == "abc0abc" &&
|
||||
"abc0abc" !== `abc${0}abc`;
|
||||
|
|
|
@ -117,10 +117,10 @@ var B = (function () {
|
|||
this.prop2 = function () { return _this; };
|
||||
this.prop3 = function () { return function () { return function () { return function () { return _this; }; }; }; };
|
||||
this.prop4 = ' ' +
|
||||
function () {
|
||||
} +
|
||||
' ' +
|
||||
(function () { return function () { return function () { return _this; }; }; });
|
||||
function () {
|
||||
} +
|
||||
' ' +
|
||||
(function () { return function () { return function () { return _this; }; }; });
|
||||
this.prop5 = {
|
||||
a: function () { return _this; }
|
||||
};
|
||||
|
|
|
@ -143,8 +143,8 @@ function foo7(x) {
|
|||
function foo8(x) {
|
||||
var b;
|
||||
return typeof x === "string" ? x === "hello" : ((b = x) &&
|
||||
(typeof x === "boolean" ? x // boolean
|
||||
: x == 10)); // number
|
||||
(typeof x === "boolean" ? x // boolean
|
||||
: x == 10)); // number
|
||||
}
|
||||
function foo9(x) {
|
||||
var y = 10;
|
||||
|
|
Loading…
Reference in a new issue