mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-02-15 03:23:08 -06:00
Merge branch 'transforms' into acceptTransformBaselines
This commit is contained in:
commit
d5aae8db52
@ -190,8 +190,9 @@ namespace RWC {
|
||||
if (compilerResult.errors.length === 0) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return Harness.Compiler.getErrorBaseline(inputFiles.concat(otherFiles), compilerResult.errors);
|
||||
// Do not include the library in the baselines to avoid noise
|
||||
const baselineFiles = inputFiles.concat(otherFiles).filter(f => !Harness.isDefaultLibraryFile(f.unitName));
|
||||
return Harness.Compiler.getErrorBaseline(baselineFiles, compilerResult.errors);
|
||||
}, false, baselineOpts);
|
||||
});
|
||||
|
||||
|
||||
@ -0,0 +1,53 @@
|
||||
//// [tests/cases/conformance/es6/modules/defaultExportInAwaitExpression01.ts] ////
|
||||
|
||||
//// [a.ts]
|
||||
const x = new Promise( ( resolve, reject ) => { resolve( {} ); } );
|
||||
export default x;
|
||||
|
||||
//// [b.ts]
|
||||
import x from './a';
|
||||
|
||||
( async function() {
|
||||
const value = await x;
|
||||
}() );
|
||||
|
||||
|
||||
//// [a.js]
|
||||
(function (dependencies, factory) {
|
||||
if (typeof module === 'object' && typeof module.exports === 'object') {
|
||||
var v = factory(require, exports); if (v !== undefined) module.exports = v;
|
||||
}
|
||||
else if (typeof define === 'function' && define.amd) {
|
||||
define(dependencies, factory);
|
||||
}
|
||||
})(["require", "exports"], function (require, exports) {
|
||||
"use strict";
|
||||
const x = new Promise((resolve, reject) => { resolve({}); });
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.default = x;
|
||||
});
|
||||
//// [b.js]
|
||||
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
||||
return new (P || (P = Promise))(function (resolve, reject) {
|
||||
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
||||
function rejected(value) { try { step(generator.throw(value)); } catch (e) { reject(e); } }
|
||||
function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
|
||||
step((generator = generator.apply(thisArg, _arguments)).next());
|
||||
});
|
||||
};
|
||||
(function (dependencies, factory) {
|
||||
if (typeof module === 'object' && typeof module.exports === 'object') {
|
||||
var v = factory(require, exports); if (v !== undefined) module.exports = v;
|
||||
}
|
||||
else if (typeof define === 'function' && define.amd) {
|
||||
define(dependencies, factory);
|
||||
}
|
||||
})(["require", "exports", "./a"], function (require, exports) {
|
||||
"use strict";
|
||||
const a_1 = require("./a");
|
||||
(function () {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
const value = yield a_1.default;
|
||||
});
|
||||
}());
|
||||
});
|
||||
@ -0,0 +1,22 @@
|
||||
=== tests/cases/conformance/es6/modules/a.ts ===
|
||||
const x = new Promise( ( resolve, reject ) => { resolve( {} ); } );
|
||||
>x : Symbol(x, Decl(a.ts, 0, 5))
|
||||
>Promise : Symbol(Promise, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --))
|
||||
>resolve : Symbol(resolve, Decl(a.ts, 0, 24))
|
||||
>reject : Symbol(reject, Decl(a.ts, 0, 33))
|
||||
>resolve : Symbol(resolve, Decl(a.ts, 0, 24))
|
||||
|
||||
export default x;
|
||||
>x : Symbol(x, Decl(a.ts, 0, 5))
|
||||
|
||||
=== tests/cases/conformance/es6/modules/b.ts ===
|
||||
import x from './a';
|
||||
>x : Symbol(x, Decl(b.ts, 0, 6))
|
||||
|
||||
( async function() {
|
||||
const value = await x;
|
||||
>value : Symbol(value, Decl(b.ts, 3, 9))
|
||||
>x : Symbol(x, Decl(b.ts, 0, 6))
|
||||
|
||||
}() );
|
||||
|
||||
@ -0,0 +1,31 @@
|
||||
=== tests/cases/conformance/es6/modules/a.ts ===
|
||||
const x = new Promise( ( resolve, reject ) => { resolve( {} ); } );
|
||||
>x : Promise<{}>
|
||||
>new Promise( ( resolve, reject ) => { resolve( {} ); } ) : Promise<{}>
|
||||
>Promise : PromiseConstructor
|
||||
>( resolve, reject ) => { resolve( {} ); } : (resolve: (value?: {} | PromiseLike<{}>) => void, reject: (reason?: any) => void) => void
|
||||
>resolve : (value?: {} | PromiseLike<{}>) => void
|
||||
>reject : (reason?: any) => void
|
||||
>resolve( {} ) : void
|
||||
>resolve : (value?: {} | PromiseLike<{}>) => void
|
||||
>{} : {}
|
||||
|
||||
export default x;
|
||||
>x : Promise<{}>
|
||||
|
||||
=== tests/cases/conformance/es6/modules/b.ts ===
|
||||
import x from './a';
|
||||
>x : Promise<{}>
|
||||
|
||||
( async function() {
|
||||
>( async function() { const value = await x;}() ) : Promise<void>
|
||||
>async function() { const value = await x;}() : Promise<void>
|
||||
>async function() { const value = await x;} : () => Promise<void>
|
||||
|
||||
const value = await x;
|
||||
>value : {}
|
||||
>await x : {}
|
||||
>x : Promise<{}>
|
||||
|
||||
}() );
|
||||
|
||||
@ -0,0 +1,35 @@
|
||||
//// [tests/cases/conformance/es6/modules/defaultExportInAwaitExpression02.ts] ////
|
||||
|
||||
//// [a.ts]
|
||||
const x = new Promise( ( resolve, reject ) => { resolve( {} ); } );
|
||||
export default x;
|
||||
|
||||
//// [b.ts]
|
||||
import x from './a';
|
||||
|
||||
( async function() {
|
||||
const value = await x;
|
||||
}() );
|
||||
|
||||
|
||||
//// [a.js]
|
||||
"use strict";
|
||||
const x = new Promise((resolve, reject) => { resolve({}); });
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.default = x;
|
||||
//// [b.js]
|
||||
"use strict";
|
||||
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
||||
return new (P || (P = Promise))(function (resolve, reject) {
|
||||
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
||||
function rejected(value) { try { step(generator.throw(value)); } catch (e) { reject(e); } }
|
||||
function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
|
||||
step((generator = generator.apply(thisArg, _arguments)).next());
|
||||
});
|
||||
};
|
||||
const a_1 = require("./a");
|
||||
(function () {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
const value = yield a_1.default;
|
||||
});
|
||||
}());
|
||||
@ -0,0 +1,22 @@
|
||||
=== tests/cases/conformance/es6/modules/a.ts ===
|
||||
const x = new Promise( ( resolve, reject ) => { resolve( {} ); } );
|
||||
>x : Symbol(x, Decl(a.ts, 0, 5))
|
||||
>Promise : Symbol(Promise, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --))
|
||||
>resolve : Symbol(resolve, Decl(a.ts, 0, 24))
|
||||
>reject : Symbol(reject, Decl(a.ts, 0, 33))
|
||||
>resolve : Symbol(resolve, Decl(a.ts, 0, 24))
|
||||
|
||||
export default x;
|
||||
>x : Symbol(x, Decl(a.ts, 0, 5))
|
||||
|
||||
=== tests/cases/conformance/es6/modules/b.ts ===
|
||||
import x from './a';
|
||||
>x : Symbol(x, Decl(b.ts, 0, 6))
|
||||
|
||||
( async function() {
|
||||
const value = await x;
|
||||
>value : Symbol(value, Decl(b.ts, 3, 9))
|
||||
>x : Symbol(x, Decl(b.ts, 0, 6))
|
||||
|
||||
}() );
|
||||
|
||||
@ -0,0 +1,31 @@
|
||||
=== tests/cases/conformance/es6/modules/a.ts ===
|
||||
const x = new Promise( ( resolve, reject ) => { resolve( {} ); } );
|
||||
>x : Promise<{}>
|
||||
>new Promise( ( resolve, reject ) => { resolve( {} ); } ) : Promise<{}>
|
||||
>Promise : PromiseConstructor
|
||||
>( resolve, reject ) => { resolve( {} ); } : (resolve: (value?: {} | PromiseLike<{}>) => void, reject: (reason?: any) => void) => void
|
||||
>resolve : (value?: {} | PromiseLike<{}>) => void
|
||||
>reject : (reason?: any) => void
|
||||
>resolve( {} ) : void
|
||||
>resolve : (value?: {} | PromiseLike<{}>) => void
|
||||
>{} : {}
|
||||
|
||||
export default x;
|
||||
>x : Promise<{}>
|
||||
|
||||
=== tests/cases/conformance/es6/modules/b.ts ===
|
||||
import x from './a';
|
||||
>x : Promise<{}>
|
||||
|
||||
( async function() {
|
||||
>( async function() { const value = await x;}() ) : Promise<void>
|
||||
>async function() { const value = await x;}() : Promise<void>
|
||||
>async function() { const value = await x;} : () => Promise<void>
|
||||
|
||||
const value = await x;
|
||||
>value : {}
|
||||
>await x : {}
|
||||
>x : Promise<{}>
|
||||
|
||||
}() );
|
||||
|
||||
@ -0,0 +1,12 @@
|
||||
// @target: ES6
|
||||
// @module: umd
|
||||
// @filename: a.ts
|
||||
const x = new Promise( ( resolve, reject ) => { resolve( {} ); } );
|
||||
export default x;
|
||||
|
||||
// @filename: b.ts
|
||||
import x from './a';
|
||||
|
||||
( async function() {
|
||||
const value = await x;
|
||||
}() );
|
||||
@ -0,0 +1,12 @@
|
||||
// @target: ES6
|
||||
// @module: commonjs
|
||||
// @filename: a.ts
|
||||
const x = new Promise( ( resolve, reject ) => { resolve( {} ); } );
|
||||
export default x;
|
||||
|
||||
// @filename: b.ts
|
||||
import x from './a';
|
||||
|
||||
( async function() {
|
||||
const value = await x;
|
||||
}() );
|
||||
Loading…
x
Reference in New Issue
Block a user