* use getters to define live export bindings * fix scoping in export* helper * Object.defineProperty cannot be used in ES3 target * Accept changed baselines * Use function expression, not arrow function * Update importStarHelper to match export helper in binding-making * Fix whitespace * Adjust whitespace in edited helpers * Use new helper for setting bindings, use unscoped __exportStar helper for exports so helpers get reused more * Accept updated baselines * Use __createBinding for individual reexports when target is es3 * Remove unneeded type assertion * Singeline the helpers * Add check for createBinding helper, accept updated baselines with shortened helper Co-authored-by: Michael Rawlings <mirawlings@ebay.com>
33 lines
1,000 B
TypeScript
33 lines
1,000 B
TypeScript
//// [tests/cases/compiler/pathMappingBasedModuleResolution6_classic.ts] ////
|
|
|
|
//// [file1.ts]
|
|
import {x} from "./project/file3";
|
|
declare function use(x: string);
|
|
use(x.toExponential());
|
|
|
|
//// [file2.d.ts]
|
|
export let x: number;
|
|
|
|
//// [file3.ts]
|
|
export {x} from "../file2";
|
|
|
|
//// [file3.js]
|
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
if (k2 === undefined) k2 = k;
|
|
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
}) : (function(o, m, k, k2) {
|
|
if (k2 === undefined) k2 = k;
|
|
o[k2] = m[k];
|
|
}));
|
|
define(["require", "exports", "../file2"], function (require, exports, file2_1) {
|
|
"use strict";
|
|
exports.__esModule = true;
|
|
__createBinding(exports, file2_1, "x");
|
|
});
|
|
//// [file1.js]
|
|
define(["require", "exports", "./project/file3"], function (require, exports, file3_1) {
|
|
"use strict";
|
|
exports.__esModule = true;
|
|
use(file3_1.x.toExponential());
|
|
});
|