proposal-decorators icon indicating copy to clipboard operation
proposal-decorators copied to clipboard

What would it mean to "decorate an export"?

Open rbuckton opened this issue 5 years ago • 37 comments

This is a question often brought up in other issues (most recently in https://github.com/tc39/proposal-decorators/issues/69#issuecomment-409734868) that might need to be better explored. The way I see it, there are a number of specific subtopics related to this:

  • If you could "decorate" any export, what would you expect to be able to do?
  • How would decorating an export affect the static semantics for import/export?
  • How would you apply a decorator to the following statements in a consistent and unambiguous way:
    • export * from "module";
    • export function F() {}
    • export class C {}
    • export default function() {}
    • export default class {}
    • export default expr;
    • export { x };
    • export { x as y };
  • Are there runtime semantics concerns with decorating exports?
  • Are there security concerns with decorating exports?

rbuckton avatar Aug 02 '18 21:08 rbuckton