Accepting new baselines

This commit is contained in:
Anders Hejlsberg 2015-05-12 15:51:20 -07:00
parent c4b6e64ca6
commit fe4dd84d19
5 changed files with 16 additions and 16 deletions

View File

@ -26,7 +26,7 @@ function f2() {
//// [arrayLiteralSpread.js]
function f0() {
var a = [1, 2, 3];
var a1 = a;
var a1 = a.slice();
var a2 = [1].concat(a);
var a3 = [1, 2].concat(a);
var a4 = a.concat([1]);
@ -41,6 +41,6 @@ function f1() {
var b;
}
function f2() {
var a = [];
var b = [5];
var a = [].slice().slice().slice().slice().slice();
var b = [5].slice().slice().slice().slice().slice();
}

View File

@ -93,12 +93,12 @@ var temp2 = [[1, 2, 3], ["hello", "string"]];
var temp3 = [undefined, null, undefined];
var temp4 = [];
var d0 = [1, true].concat(temp); // has type (string|number|boolean)[]
var d1 = temp; // has type string[]
var d2 = temp1;
var d3 = temp1;
var d1 = temp.slice(); // has type string[]
var d2 = temp1.slice();
var d3 = temp1.slice();
var d4 = temp.concat(temp1);
var d5 = temp3;
var d6 = temp4;
var d7 = temp1;
var d8 = [temp1];
var d9 = [temp1].concat(["hello"]);
var d5 = temp3.slice();
var d6 = temp4.slice();
var d7 = temp1.slice().slice();
var d8 = [temp1.slice()];
var d9 = [temp1.slice()].concat(["hello"]);

View File

@ -55,6 +55,6 @@ var _a = [1, 2, "string", true], b1 = _a[0], b2 = _a[1];
var temp = ["s", "t", "r"];
var temp1 = [1, 2, 3];
var temp2 = [[1, 2, 3], ["hello", "string"]];
var c0 = temp2; // Error
var c1 = temp1; // Error cannot assign number[] to [number, number, number]
var c0 = temp2.slice(); // Error
var c1 = temp1.slice(); // Error cannot assign number[] to [number, number, number]
var c2 = temp1.concat(temp); // Error cannot assign (number|string)[] to number[]

View File

@ -88,7 +88,7 @@ var _e = foo(), b6 = _e[0], b7 = _e[1];
var b8 = foo().slice(0);
// S is not a tuple- like type and the numeric index signature type of S is assignable to the target given in E.
var temp = [1, 2, 3];
var _f = temp, c0 = _f[0], c1 = _f[1];
var _f = temp.slice(), c0 = _f[0], c1 = _f[1];
var c2 = [][0];
var _g = [[[]], [[[[]]]]], c3 = _g[0][0][0], c4 = _g[1][0][0][0][0];
var _h = [[1], true], c5 = _h[0][0], c6 = _h[1];

View File

@ -50,8 +50,8 @@ var _c = bar(), _d = _c[0], b3 = _d === void 0 ? "string" : _d, b4 = _c[1], b5 =
// V is an array assignment pattern, S is the type Any or an array-like type (section 3.3.2), and, for each assignment element E in V,
// S is not a tuple- like type and the numeric index signature type of S is assignable to the target given in E.
var temp = [1, 2, 3];
var _e = temp, c0 = _e[0], c1 = _e[1]; // Error
var _f = temp, c2 = _f[0], c3 = _f[1]; // Error
var _e = temp.slice(), c0 = _e[0], c1 = _e[1]; // Error
var _f = temp.slice(), c2 = _f[0], c3 = _f[1]; // Error
function foo(idx) {
return {
2: true