mirror of
https://github.com/radareorg/quickjs.git
synced 2026-11-07 06:25:57 -10:00
Support for ES2020 arbitrary module namespace identifier names,
which allows using string literals as export/import names.
Examples:
```js
export { foo as "string-name" }
import { "string-name" as foo }
export * as "string-name" from "./mod.js"
```
13 lines
371 B
JavaScript
13 lines
371 B
JavaScript
// ES2020 string export names test fixture
|
|
export const regularExport = "regular";
|
|
const value1 = "value-1";
|
|
const value2 = "value-2";
|
|
|
|
// String export names (ES2020)
|
|
export { value1 as "string-export-1" };
|
|
export { value2 as "string-export-2" };
|
|
|
|
// Mixed: regular and string exports
|
|
const mixed = "mixed-value";
|
|
export { mixed as normalName, mixed as "string-name" };
|