Skip to content

Instantly share code, notes, and snippets.

@bouzuya
Created May 28, 2020 04:00
Show Gist options
  • Select an option

  • Save bouzuya/4dcaef575c1c643eb5e88bcd0189aae2 to your computer and use it in GitHub Desktop.

Select an option

Save bouzuya/4dcaef575c1c643eb5e88bcd0189aae2 to your computer and use it in GitHub Desktop.

Revisions

  1. bouzuya created this gist May 28, 2020.
    1 change: 1 addition & 0 deletions f.ts
    Original file line number Diff line number Diff line change
    @@ -0,0 +1 @@
    export function f() {}
    2 changes: 2 additions & 0 deletions m1.ts
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,2 @@
    import { f } from "./f";
    export { f };
    1 change: 1 addition & 0 deletions m2.ts
    Original file line number Diff line number Diff line change
    @@ -0,0 +1 @@
    export { f } from "./f";
    1 change: 1 addition & 0 deletions m3.ts
    Original file line number Diff line number Diff line change
    @@ -0,0 +1 @@
    export * from "./f";
    8 changes: 8 additions & 0 deletions main.ts
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,8 @@
    import assert from "assert";
    import * as m1 from "./m1";
    import * as m2 from "./m2";
    import * as m3 from "./m3";

    assert(Object.getOwnPropertyDescriptor(m1, "f")?.configurable === true);
    assert(Object.getOwnPropertyDescriptor(m2, "f")?.configurable === false);
    assert(Object.getOwnPropertyDescriptor(m3, "f")?.configurable === false);