* Preserve the variable name when exporting an arrow or anonymous function This allows the browser or node to properly name the (arrow) function * Updated tests to reflect previous change * Remove duplicated comment * Transforms variable.initializer using moduleExpressionElementVisitor * PR feedback: rbuckton - Use isArrowFunction and isFunctionExpression * PR feedback: rbuckton - Consider ClassExpresion, they can also be named based on the variable.
33 lines
805 B
TypeScript
33 lines
805 B
TypeScript
//// [errorsWithInvokablesInUnions01.ts]
|
|
interface ConstructableA {
|
|
new(): { somePropA: any };
|
|
}
|
|
|
|
interface IDirectiveLinkFn<TScope> {
|
|
(scope: TScope): void;
|
|
}
|
|
|
|
interface IDirectivePrePost<TScope> {
|
|
pre?: IDirectiveLinkFn<TScope>;
|
|
post?: IDirectiveLinkFn<TScope>;
|
|
}
|
|
|
|
export let blah: IDirectiveLinkFn<number> | ConstructableA | IDirectivePrePost<number> = (x: string) => {}
|
|
|
|
export let ctor: IDirectiveLinkFn<number> | ConstructableA | IDirectivePrePost<number> = class {
|
|
someUnaccountedProp: any;
|
|
}
|
|
|
|
|
|
//// [errorsWithInvokablesInUnions01.js]
|
|
"use strict";
|
|
exports.__esModule = true;
|
|
exports.ctor = exports.blah = void 0;
|
|
var blah = function (x) { };
|
|
exports.blah = blah;
|
|
exports.ctor = /** @class */ (function () {
|
|
function class_1() {
|
|
}
|
|
return class_1;
|
|
}());
|