ModuleComplexExports.js 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. //-------------------------------------------------------------------------------------------------------
  2. // Copyright (C) Microsoft. All rights reserved.
  3. // Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
  4. //-------------------------------------------------------------------------------------------------------
  5. export function foo() { return 'foo'; };
  6. export { foo as foo2 };
  7. function bar() { return 'bar'; };
  8. export { bar, bar as bar2 };
  9. export let let2 = 'let2';
  10. export const const2 = 'const2';
  11. export var var2 = 'var2';
  12. export { let2 as let4, const2 as const4, var2 as var4 };
  13. let let3 = 'let3';
  14. const const3 = 'const3';
  15. var var3 = 'var3';
  16. export { let3, let3 as let5, const3, const3 as const5, var3, var3 as var5 };
  17. export class class2 {
  18. member() { return 'class2'; }
  19. static static_member() { return 'class2'; }
  20. };
  21. export { class2 as class3 };
  22. class class4 {
  23. member() { return 'class4'; }
  24. static static_member() { return 'class4'; }
  25. };
  26. export { class4, class4 as class5 };
  27. export async function asyncfoo() { };
  28. async function asyncbar() { };
  29. export { asyncfoo as asyncfoo2, asyncbar, asyncbar as asyncbar2 };
  30. export function* genfoo() { };
  31. function* genbar() { };
  32. export { genfoo as genfoo2, genbar, genbar as genbar2 };
  33. export default function () { return 'default'; };
  34. var mutatingExportTarget;
  35. function resetMutatingExportTarget() {
  36. mutatingExportTarget = function() { return 'before'; };
  37. return 'ok';
  38. }
  39. function changeMutatingExportTarget() {
  40. mutatingExportTarget = function() { return 'after'; };
  41. return 'ok';
  42. }
  43. resetMutatingExportTarget();
  44. export { mutatingExportTarget as target, changeMutatingExportTarget as changeTarget, resetMutatingExportTarget as reset};
  45. var exportedAsKeyword = 'ModuleComplexExports';
  46. export { exportedAsKeyword as export };
  47. export { exportedAsKeyword as function };
  48. var as = function() { return 'as'; };
  49. export { as as as };