Accept baselines: syntactically invalid input

This commit is contained in:
Mohamed Hegazy
2016-04-12 16:25:19 -07:00
parent 7c3df5acc7
commit 7077003731
30 changed files with 55 additions and 44 deletions

View File

@@ -6,7 +6,7 @@ class foo {
//// [constructorArgsErrors1.js]
var foo = (function () {
function foo(a) {
function foo(static a) {
}
return foo;
}());

View File

@@ -7,7 +7,7 @@ class foo {
//// [constructorArgsErrors5.js]
var foo = (function () {
function foo(a) {
function foo(export a) {
}
return foo;
}());

View File

@@ -32,10 +32,17 @@ function a(_a) {
function a1(_a) {
var public = _a.public;
}
function a4(_a) { }
while (, )
for (, public; ; )
;
{ }
function a5() {
var = [];
for (var _i = 0; _i < arguments.length; _i++) {
[_i - 0] = arguments[_i];
}
}
while () { }
function a6() {
var public = [];

View File

@@ -10,9 +10,9 @@ enum Nums {
//// [enumIdentifierLiterals.js]
var Nums;
(function (Nums) {
Nums[Nums["1"] = 0] = "1";
Nums[Nums["1.1"] = 1] = "1.1";
Nums[Nums["1.2"] = 2] = "1.2";
Nums[Nums[1] = 0] = 1;
Nums[Nums[1.1] = 1] = 1.1;
Nums[Nums[1.2] = 2] = 1.2;
Nums[Nums["13e-1"] = 3] = "13e-1";
Nums[Nums["61453"] = 4] = "61453";
Nums[Nums[61453] = 4] = 61453;
})(Nums || (Nums = {}));

View File

@@ -53,7 +53,7 @@ var Bbb;
return SomeType;
}());
Bbb.SomeType = SomeType;
// this line causes the nullref
export * from Aaa; // this line causes the nullref
})(Bbb || (Bbb = {}));
var a;

View File

@@ -13,6 +13,5 @@ function* g() {
*[yield 0]() {
yield 0;
}
}
;
};
}

View File

@@ -13,5 +13,6 @@ export module myModule {
"use strict";
var myModule;
(function (myModule) {
import foo = require("importInsideModule_file1");
var a = foo.x;
})(myModule = exports.myModule || (exports.myModule = {}));

View File

@@ -14,5 +14,5 @@ for (let in [1,2,3]) {}
// This should be an error
// More details: http://www.ecma-international.org/ecma-262/6.0/#sec-iteration-statements
var let = 10;
for (let of = [1, 2, 3], { }; ; )
for ( in [1, 2, 3]) { }
for (let of = [1, 2, 3], {}; ; )
for (let in [1, 2, 3]) { }

View File

@@ -14,5 +14,5 @@ for (let in [1,2,3]) {}
// This should be an error
// More details: http://www.ecma-international.org/ecma-262/6.0/#sec-iteration-statements
var let = 10;
for (let of = [1, 2, 3], { }; ; )
for ( in [1, 2, 3]) { }
for (let of = [1, 2, 3], {}; ; )
for (let in [1, 2, 3]) { }

View File

@@ -39,11 +39,11 @@ var Y2;
})(Y2 || (Y2 = {}));
var Y4;
(function (Y4) {
var x = 0;
static var x = 0;
})(Y4 || (Y4 = {}));
var YY;
(function (YY) {
function fn(x) { }
static function fn(x) { }
})(YY || (YY = {}));
var YY2;
(function (YY2) {

View File

@@ -22,4 +22,5 @@ var x = 0;
var M;
(function (M) {
M.v;
export { x };
})(M = exports.M || (exports.M = {}));

View File

@@ -32,16 +32,15 @@ var a;
var C = (function () {
function C() {
}
C.prototype.x = ;
C.prototype.x = function () { };
return C;
}());
var C2 = (function () {
function C2() {
}
C2.prototype.x = ;
C2.prototype.x = function () { };
return C2;
}());
var b = {
x: function () { }, 1: // error
// error
x: function () { }, 1: // error
};

View File

@@ -14,13 +14,15 @@ class C {
//// [overloadConsecutiveness.js]
// Making sure compiler won't break with declarations that are consecutive in the AST but not consecutive in the source. Syntax errors intentional.
function f1() { }
function f2() { }
function f2() { }
function f3() { }
var C = (function () {
function C() {
}
C.prototype.m1 = ;
C.prototype.m2 = ;
C.prototype.m1 = function () { };
C.prototype.m2 = function () { };
C.prototype.m2 = function () { };
C.prototype.m3 = function () { };
return C;

View File

@@ -6,4 +6,5 @@ module M {
//// [parserExportAssignment5.js]
var M;
(function (M) {
export = A;
})(M || (M = {}));

View File

@@ -3,5 +3,5 @@ for (var a, b in X) {
}
//// [parserForInStatement3.js]
for (var a in X) {
for (var a, b in X) {
}

View File

@@ -3,5 +3,5 @@ for (var a = 1, b = 2 in X) {
}
//// [parserForInStatement6.js]
for (var a = 1 in X) {
for (var a = 1, b = 2 in X) {
}

View File

@@ -3,5 +3,5 @@ for (var a: number = 1, b: string = "" in X) {
}
//// [parserForInStatement7.js]
for (var a = 1 in X) {
for (var a = 1, b = "" in X) {
}

View File

@@ -3,5 +3,5 @@ for (var a, b of X) {
}
//// [parserForOfStatement3.js]
for (var a of X) {
for (var a, b of X) {
}

View File

@@ -3,5 +3,5 @@ for (var a = 1, b = 2 of X) {
}
//// [parserForOfStatement6.js]
for (var a = 1 of X) {
for (var a = 1, b = 2 of X) {
}

View File

@@ -3,5 +3,5 @@ for (var a: number = 1, b: string = "" of X) {
}
//// [parserForOfStatement7.js]
for (var a = 1 of X) {
for (var a = 1, b = "" of X) {
}

View File

@@ -7,7 +7,7 @@ class C {
var C = (function () {
function C() {
}
Object.defineProperty(C.prototype, "0", {
Object.defineProperty(C.prototype, 0, {
get: function () { },
enumerable: true,
configurable: true

View File

@@ -7,7 +7,7 @@ class C {
var C = (function () {
function C() {
}
Object.defineProperty(C.prototype, "0", {
Object.defineProperty(C.prototype, 0, {
set: function (i) { },
enumerable: true,
configurable: true

View File

@@ -7,6 +7,6 @@ export function foo() {
//// [parserModifierOnStatementInBlock1.js]
"use strict";
function foo() {
exports.x = this;
export var x = this;
}
exports.foo = foo;

View File

@@ -23,6 +23,7 @@ while (from)
var ;
typeof ;
10;
function () { }
throw function () { };
module;
void {};

View File

@@ -5,7 +5,7 @@ class C {
//// [restParamModifier.js]
var C = (function () {
function C(public, string) {
function C(string) {
if (string === void 0) { string = []; }
}
return C;

View File

@@ -2,4 +2,4 @@
function f(...x, y) { }
//// [restParameterNotLast.js]
function f(x, y) { }
function f(y) { }

View File

@@ -40,7 +40,7 @@ var f = function foo() {
x[_i - 0] = arguments[_i];
}
};
var f2 = function (x) {
var f2 = function () {
var y = [];
for (var _i = 1; _i < arguments.length; _i++) {
y[_i - 1] = arguments[_i];
@@ -65,7 +65,7 @@ var b = {
x[_i - 0] = arguments[_i];
}
},
a: function foo(x) {
a: function foo() {
var y = [];
for (var _i = 1; _i < arguments.length; _i++) {
y[_i - 1] = arguments[_i];

View File

@@ -39,7 +39,7 @@ var f = function foo() {
x[_i - 0] = arguments[_i];
}
};
var f2 = function (x) {
var f2 = function () {
var y = [];
for (var _i = 1; _i < arguments.length; _i++) {
y[_i - 1] = arguments[_i];
@@ -64,7 +64,7 @@ var b = {
x[_i - 0] = arguments[_i];
}
},
a: function foo(x) {
a: function foo() {
var y = [];
for (var _i = 1; _i < arguments.length; _i++) {
y[_i - 1] = arguments[_i];

View File

@@ -71,7 +71,7 @@ var f = function foo() {
x[_i - 0] = arguments[_i];
}
};
var f2 = function (x) {
var f2 = function () {
var y = [];
for (var _i = 1; _i < arguments.length; _i++) {
y[_i - 1] = arguments[_i];
@@ -96,7 +96,7 @@ var b = {
x[_i - 0] = arguments[_i];
}
},
a: function foo(x) {
a: function foo() {
var y = [];
for (var _i = 1; _i < arguments.length; _i++) {
y[_i - 1] = arguments[_i];
@@ -121,7 +121,7 @@ var f3 = function foo() {
x[_i - 0] = arguments[_i];
}
};
var f4 = function (x) {
var f4 = function () {
var y = [];
for (var _i = 1; _i < arguments.length; _i++) {
y[_i - 1] = arguments[_i];
@@ -146,7 +146,7 @@ var b2 = {
x[_i - 0] = arguments[_i];
}
},
a: function foo(x) {
a: function foo() {
var y = [];
for (var _i = 1; _i < arguments.length; _i++) {
y[_i - 1] = arguments[_i];

View File

@@ -66,7 +66,7 @@ var f = function foo() {
x[_i - 0] = arguments[_i];
}
};
var f2 = function (x) {
var f2 = function () {
var y = [];
for (var _i = 1; _i < arguments.length; _i++) {
y[_i - 1] = arguments[_i];
@@ -91,7 +91,7 @@ var b = {
x[_i - 0] = arguments[_i];
}
},
a: function foo(x) {
a: function foo() {
var y = [];
for (var _i = 1; _i < arguments.length; _i++) {
y[_i - 1] = arguments[_i];
@@ -116,7 +116,7 @@ var f3 = function foo() {
x[_i - 0] = arguments[_i];
}
};
var f4 = function (x) {
var f4 = function () {
var y = [];
for (var _i = 1; _i < arguments.length; _i++) {
y[_i - 1] = arguments[_i];
@@ -141,7 +141,7 @@ var b2 = {
x[_i - 0] = arguments[_i];
}
},
a: function foo(x) {
a: function foo() {
var y = [];
for (var _i = 1; _i < arguments.length; _i++) {
y[_i - 1] = arguments[_i];